FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 # System deps: OpenCV headless needs libgl, ffmpeg for video decoding, # build-essential for pycocotools compilation RUN apt-get update && \ apt-get install -y --no-install-recommends \ python3 python3-pip python3-dev \ libgl1 libglib2.0-0 ffmpeg build-essential && \ rm -rf /var/lib/apt/lists/* RUN ln -sf /usr/bin/python3 /usr/bin/python WORKDIR /app # Install PyTorch with CUDA 12.1 RUN pip install --no-cache-dir \ torch==2.5.1 torchvision==0.20.1 \ --index-url https://download.pytorch.org/whl/cu121 COPY requirements.txt . # Install videoseal without deps to avoid decord (no ARM64 wheels). RUN pip install --no-cache-dir -r requirements.txt && \ pip install --no-cache-dir --no-deps videoseal==1.0.1 && \ apt-get purge -y --auto-remove build-essential && \ rm -rf /var/lib/apt/lists/* COPY app.py . COPY configs/ configs/ ENV MODEL_PORT=9004 ENV PRELOAD_MODEL=false ENV MODEL_TIMEOUT=600 EXPOSE 9004 # Pre-create cache dirs that videoseal needs (before dropping root) RUN mkdir -p /app/ckpts /app/.cache COPY ckpts/ /app/ckpts/ RUN adduser --disabled-password --gecos "" appuser && \ chown -R appuser:appuser /app/ckpts /app/.cache USER appuser CMD ["python", "app.py"]