# syntax=docker/dockerfile:1.4 # Base image FROM python:3.12-slim AS base # Install system dependencies for OpenCV and ffmpeg at runtime RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ libgl1-mesa-glx \ libglib2.0-0 \ libsm6 \ libxext6 \ libx11-dev \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # Builder stage: install Python dependencies WORKDIR /app # 4. Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --default-timeout=100 --no-cache-dir -r requirements.txt # 5. Copy app source COPY . . EXPOSE 7860 CMD ["python", "demo_v5.py"]