Spaces:
Sleeping
Sleeping
| # USE UBUNTU 22.04 (More stable networking than Python-slim) | |
| FROM ubuntu:22.04 | |
| # Prevent interactive prompts (timezone, etc.) | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install Python, FFmpeg, and critical network tools | |
| RUN apt-get update && apt-get install -y \ | |
| python3 \ | |
| python3-pip \ | |
| ffmpeg \ | |
| git \ | |
| ca-certificates \ | |
| dnsutils \ | |
| iputils-ping \ | |
| && update-ca-certificates \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Fix: Make 'python' command point to 'python3' | |
| RUN ln -s /usr/bin/python3 /usr/bin/python | |
| # Create a non-root user (Required by Hugging Face) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| # Copy your files | |
| COPY --chown=user . $HOME/app | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Create the jobs directory | |
| RUN mkdir -p jobs | |
| # Run the app | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |