FROM python:3.11-slim # Install ffmpeg and fontconfig (required for subtitle burn) RUN apt-get update -qq && \ apt-get install -y --no-install-recommends \ ffmpeg \ fontconfig \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt COPY . . # HuggingFace Spaces run on port 7860 EXPOSE 7860 ENV PORT=7860 ENV WORK_DIR=/tmp/moviepluz RUN mkdir -p /tmp/moviepluz # --timeout 0 → gunicorn never kills long-running requests # --worker-class gthread → allows background threads (pipeline) to keep running # --threads 4 → handle concurrent webhook + /logs requests while pipeline runs CMD ["gunicorn", \ "--bind", "0.0.0.0:7860", \ "--timeout", "0", \ "--worker-class", "gthread", \ "--workers", "1", \ "--threads", "4", \ "--keep-alive", "300", \ "app:app"]