FROM python:3.12-slim # ffmpeg is non-negotiable — yt-dlp will silently fail without it RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install deps first so Docker layer cache doesn't rebuild on code changes COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY main.py . EXPOSE 8000 CMD ["python3", "main.py"]