File size: 1,301 Bytes
7c7f64c
 
c39b2e2
7c7f64c
 
 
 
c39b2e2
 
 
 
7c7f64c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c39b2e2
 
 
 
 
 
7c7f64c
c39b2e2
 
 
 
 
7c7f64c
c39b2e2
 
 
7c7f64c
c39b2e2
 
7c7f64c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Use Python 3.11 slim image for smaller size and CPU compatibility
FROM python:3.11-slim

# Set environment variables for Gradio to listen on all interfaces (required for HF Spaces)
ENV GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=7860 \
    PYTHONUNBUFFERED=1

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    build-essential \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean

# Install uv package manager
RUN pip install --no-cache-dir uv

# Clone the ROOP-FLOYD repository
WORKDIR /app
RUN git clone https://codeberg.org/Cognibuild/ROOP-FLOYD.git .

# Install PyTorch CPU version for maximum compatibility
RUN uv pip install --system --no-cache \
    torch torchvision --index-url https://download.pytorch.org/whl/cpu

# Install all required Python packages
RUN uv pip install --system --no-cache \
    numpy \
    opencv-python-headless \
    onnx \
    insightface \
    albucore \
    psutil \
    onnxruntime \
    tqdm \
    ftfy \
    regex \
    pyvirtualcam

# Install specific versions as required by the application
RUN pip install --no-cache-dir --force-reinstall pydantic==2.10.6
RUN pip install --no-cache-dir gradio==5.13.0

# Expose port 7860 for the Gradio interface
EXPOSE 7860

# Run the application
CMD ["python", "run.py"]