| # 1. Use Python 3.10 (More stable wheels) | |
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # 2. Install FFmpeg | |
| RUN apt-get update && apt-get install -y \ | |
| ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 3. Upgrade PIP | |
| RUN pip install --no-cache-dir --upgrade pip | |
| # 4. Install All Dependencies (Standard Method) | |
| # We increased the timeout to 1000 seconds just in case | |
| COPY ./requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt --timeout 1000 | |
| # 5. Setup User | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| COPY . /app | |
| # 6. Launch | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |