swappy / Dockerfile
triflix's picture
Update Dockerfile
604afea verified
# Base image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies + build tools
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
libsm6 \
libxext6 \
libgl1 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Clone the repo
RUN git clone https://codeberg.org/Cognibuild/ROOP-FLOYD/ .
WORKDIR /app
# Install uv package manager (pinned to stable version)
RUN pip install uv==0.8.19
# Install dependencies in exact sequence (with --system for uv)
RUN uv pip install --system torch torchvision --index-url https://download.pytorch.org/whl/cu128
RUN uv pip install --system numpy
RUN uv pip install --system opencv-python-headless
RUN uv pip install --system onnx
RUN uv pip install --system insightface
RUN uv pip install --system albucore
RUN uv pip install --system psutil
RUN uv pip install --system onnxruntime
RUN pip install onnxruntime-gpu
RUN uv pip install --system tqdm
RUN uv pip install --system ftfy
RUN uv pip install --system regex
RUN uv pip install --system pyvirtualcam
# Specific versions for gradio and pydantic
RUN pip install --force-reinstall pydantic==2.10.6
RUN pip install --upgrade gradio==5.13.0
# Expose Gradio default port for Hugging Face Spaces
EXPOSE 7860
# Run the app
CMD ["python", "run.py"]