# ── Base image ────────────────────────────────────────────────────────────── # HF Spaces expects port 7860 and runs as a non-root user by default. # python:3.10-slim keeps the image lean; ffmpeg handles any resample needs. FROM python:3.10-slim # ── System deps ───────────────────────────────────────────────────────────── RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # ── Working directory ──────────────────────────────────────────────────────── WORKDIR /app # ── Python deps ────────────────────────────────────────────────────────────── COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # ── App code ───────────────────────────────────────────────────────────────── COPY app.py . # ── HF Spaces: non-root user required ──────────────────────────────────────── RUN useradd -m appuser USER appuser # ── Expose HF Spaces default port ──────────────────────────────────────────── EXPOSE 7860 # ── Start ───────────────────────────────────────────────────────────────────── CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]