forked from Comfy-Org/ComfyUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (42 loc) · 1.53 KB
/
Dockerfile
File metadata and controls
50 lines (42 loc) · 1.53 KB
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
50
# Dockerfile pour ComfyUI (Nvidia GPU, Python 3.10+)
FROM nvidia/cuda:12.8.0-cudnn9-devel-ubuntu22.04
# Dépendances système de base
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv git libgl1 libglib2.0-0 ffmpeg && \
rm -rf /var/lib/apt/lists/*
# Variables d'environnement
ENV PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1
# Création d'un utilisateur non-root
RUN useradd -ms /bin/bash comfyuser
USER comfyuser
WORKDIR /home/comfyuser/app
# Copie du code source
COPY --chown=comfyuser:comfyuser . .
# Installation des dépendances Python
RUN python3 -m venv .venv && \
.venv/bin/pip install --upgrade pip && \
.venv/bin/pip install -r requirements.txt
# Exposition du port par défaut
EXPOSE 8188
# Volumes pour tous les dossiers importants
VOLUME [ \
"/home/comfyuser/app/models/checkpoints", \
"/home/comfyuser/app/models/vae", \
"/home/comfyuser/app/models/loras", \
"/home/comfyuser/app/models/embeddings", \
"/home/comfyuser/app/models/controlnet", \
"/home/comfyuser/app/models/diffusers", \
"/home/comfyuser/app/models/upscale_models", \
"/home/comfyuser/app/models/clip", \
"/home/comfyuser/app/models/clip_vision", \
"/home/comfyuser/app/models/photomaker", \
"/home/comfyuser/app/models/vae_approx", \
"/home/comfyuser/app/input", \
"/home/comfyuser/app/output", \
"/home/comfyuser/app/custom_nodes", \
"/home/comfyuser/app/user" \
]
# Commande de lancement
CMD ["/home/comfyuser/app/.venv/bin/python", "main.py", "--listen", "0.0.0.0"]