FROM python:3.11-slim # System dependencies RUN apt-get update && apt-get install -y \ ffmpeg \ cmake \ build-essential \ libgl1 \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgomp1 \ && rm -rf /var/lib/apt/lists/* # Install yt-dlp RUN pip install --no-cache-dir yt-dlp WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy app COPY main.py . # Writable dirs for models and temp files RUN mkdir -p /tmp/clipcut /tmp/insightface /tmp/ultralytics ENV INSIGHTFACE_HOME=/tmp ENV YOLO_CONFIG_DIR=/tmp/ultralytics EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]