Spaces:
Sleeping
Sleeping
File size: 2,094 Bytes
a83fdf5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # ── 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"] |