FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 # Install system dependencies RUN apt-get update && apt-get install -y \ python3.10 \ python3-pip \ ffmpeg \ git \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements first for better caching COPY requirements.txt . # Install Python dependencies RUN pip3 install --no-cache-dir -r requirements.txt # Copy application files COPY app.py . # Expose port EXPOSE 7860 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:7860/ || exit 1 # Run the application CMD ["python3", "app.py"]