etsadiz commited on
Commit
6c321eb
·
verified ·
1 Parent(s): 8b42dc1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -8
Dockerfile CHANGED
@@ -1,18 +1,26 @@
1
 
2
  FROM python:3.11
3
 
4
- RUN apt-get update && apt-get install -y git
 
 
 
 
5
 
 
6
  WORKDIR /app
7
 
 
8
  RUN git clone https://github.com/comfyanonymous/ComfyUI.git
9
 
 
10
  WORKDIR /app/ComfyUI
11
 
 
12
  RUN pip install --upgrade pip
13
 
14
- # Remove CUDA builds if present
15
- RUN pip uninstall -y torch torchvision torchaudio || true
16
 
17
  # Install CPU-only PyTorch stack
18
  RUN pip install \
@@ -21,16 +29,36 @@ RUN pip install \
21
  torchaudio \
22
  --index-url https://download.pytorch.org/whl/cpu
23
 
24
- # Install requirements
25
  RUN pip install -r requirements.txt
26
 
27
- # Install Manager requirements
28
  RUN pip install -r manager_requirements.txt
29
 
30
- # Configure ComfyUI-Manager security
31
- RUN mkdir -p /app/ComfyUI/user/__manager
 
 
 
 
 
 
 
 
 
32
  RUN printf "[default]\nsecurity_level = weak\n" > /app/ComfyUI/user/__manager/config.ini
33
 
 
 
 
 
 
34
  EXPOSE 7860
35
 
36
- CMD ["python", "main.py","--cpu","--enable-manager","--enable-manager-legacy-ui","--listen","0.0.0.0","--port","7860"]
 
 
 
 
 
 
 
1
 
2
  FROM python:3.11
3
 
4
+ # Install system packages
5
+ RUN apt-get update && apt-get install -y \
6
+ git \
7
+ curl \
8
+ wget
9
 
10
+ # Set working directory
11
  WORKDIR /app
12
 
13
+ # Clone ComfyUI
14
  RUN git clone https://github.com/comfyanonymous/ComfyUI.git
15
 
16
+ # Enter ComfyUI directory
17
  WORKDIR /app/ComfyUI
18
 
19
+ # Upgrade pip
20
  RUN pip install --upgrade pip
21
 
22
+ # Remove possible CUDA packages
23
+ RUN pip uninstall -y torch torchvision torchaudio xformers || true
24
 
25
  # Install CPU-only PyTorch stack
26
  RUN pip install \
 
29
  torchaudio \
30
  --index-url https://download.pytorch.org/whl/cpu
31
 
32
+ # Install ComfyUI requirements
33
  RUN pip install -r requirements.txt
34
 
35
+ # Install ComfyUI Manager requirements
36
  RUN pip install -r manager_requirements.txt
37
 
38
+ # =========================
39
+ # ComfyUI Manager Security Fix
40
+ # =========================
41
+
42
+ ENV COMFYUI_MANAGER_SECURITY_LEVEL=weak
43
+ ENV COMFYUI_MANAGER_DISABLE_SECURITY_POLICY=true
44
+
45
+ # Create manager config directory
46
+ RUN mkdir -p /app/ComfyUI/user/__manager
47
+
48
+ # Create manager config
49
  RUN printf "[default]\nsecurity_level = weak\n" > /app/ComfyUI/user/__manager/config.ini
50
 
51
+ # Optional useful environment settings
52
+ ENV PYTHONUNBUFFERED=1
53
+ ENV HF_HUB_DISABLE_TELEMETRY=1
54
+
55
+ # Expose ComfyUI port
56
  EXPOSE 7860
57
 
58
+ # Start ComfyUI in CPU mode
59
+ CMD ["python", "main.py", \
60
+ "--cpu", \
61
+ "--enable-manager", \
62
+ "--enable-manager-legacy-ui", \
63
+ "--listen", "0.0.0.0", \
64
+ "--port", "7860"]