File size: 843 Bytes
b6d96d8
 
 
 
 
 
 
 
 
 
 
18ccdb8
60ede7c
b6d96d8
 
 
 
 
 
 
 
962fb04
 
 
 
 
b6d96d8
 
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
FROM python:3.11

# Cài phụ thuộc hệ thống
RUN apt-get update && apt-get install -y \
    git ffmpeg libgl1 libglib2.0-0 curl wget unzip \
    && rm -rf /var/lib/apt/lists/*

# Làm việc trong workspace
WORKDIR /workspace
RUN git clone https://github.com/comfyanonymous/ComfyUI.git

RUN sed -i 's/torch.device(torch.cuda.current_device())/torch.device("cpu")/' /workspace/ComfyUI/comfy/model_management.py

# Cài Python package
WORKDIR /workspace/ComfyUI
RUN pip install --upgrade pip && pip install -r requirements.txt

# Cài torch bản CPU
RUN pip uninstall -y torch torchvision torchaudio
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

RUN useradd -m -u 1000 user

RUN chown -R user:1000 /workspace/ComfyUI
USER user

EXPOSE 8188
CMD ["python", "main.py", "--listen", "0.0.0.0"]