# Use a slim Python image and install ffmpeg via apt FROM python:3.11-slim # keep Python output unbuffered ENV PYTHONUNBUFFERED=1 # install ffmpeg and clean up apt cache to keep image small RUN apt-get update && \ apt-get install -y --no-install-recommends ffmpeg curl && \ rm -rf /var/lib/apt/lists/* # create app user for non-root runtime RUN useradd --create-home --shell /bin/bash appuser WORKDIR /app # copy dependency file and install Python deps COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r /app/requirements.txt # copy application code COPY . /app # expose default uvicorn port EXPOSE 7860 # run uvicorn; use a single worker (tune for your 2 vCPU instance) CMD ["python", "main.py"]