FROM python:3.10-slim # System dependencies (FFmpeg is required for yt_dlp postprocessing) RUN apt-get update \ && apt-get install -y --no-install-recommends ffmpeg curl ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install Python deps first (better layer caching) COPY requirements.txt ./ # Keep image lean and avoid version-check noise ENV PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 # Upgrade pip to avoid resolver quirks on slim images RUN python -m pip install --upgrade pip \ && pip install -r requirements.txt # Copy application code COPY app.py ./ # Default envs for Gradio; actual port may be injected by the platform as $PORT ENV GRADIO_SERVER_NAME=0.0.0.0 \ GRADIO_SERVER_PORT=7860 \ PORT=7860 # Expose default (platform may override via $PORT) EXPOSE 7860 # Run the app CMD ["python", "app.py"]