Skip to content

Commit b3db4f5

Browse files
committed
Split data volume
1 parent c8d94a8 commit b3db4f5

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

Dockerfile

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ FROM python:3.12.12-trixie
1414
# Install cmake, which is an indirect installation dependencies
1515
RUN apt-get update && apt-get install -y --no-install-recommends cmake
1616

17-
# Create a mount point for user-generated data.
18-
RUN mkdir -p \
19-
/data/input \
20-
/data/output \
21-
/data/temp \
22-
/data/user
23-
2417
# Create a regular user whose UID and GID will match the host user's at runtime.
2518
# Also create a home directory for this user (-m), as some common Python tools
2619
# (such as uv) interact with the user’s home directory.
@@ -57,24 +50,24 @@ COPY requirements.txt manager_requirements.txt ./
5750
RUN pip install --no-cache-dir --disable-pip-version-check \
5851
-r requirements.txt
5952

60-
# Install ComfyUI and link the data mount points.
53+
# Install ComfyUI
6154
COPY . .
62-
RUN ln -sf /data/* .
6355

6456
# Purely declarative: inform Docker and image users that this image is designed
6557
# to listen on port 8188 for the web GUI.
6658
EXPOSE 8188
6759

68-
# Declare persistent volumes:
69-
# - /data: stores user-generated data from ComfyUI,
70-
# - /comfyui/.venv: stores Python data generated by the entrypoint and custom
71-
# node managers,
72-
# - /comfyui/custom_nodes: stores custom nodes installed at runtime by custom
73-
# node managers,
74-
# - /comfyui/models: Stores models installed by model managers,
75-
# - /home/comfyui: stores data from Python packages that may write outside the
76-
# virtual environment and into the user’s home directory.
77-
VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/comfyui/models", "/home/comfyui" ]
60+
# Declare persistent volumes. We assign one volume per data directory to match
61+
# ComfyUI’s natural file layout and to let users selectively choose which
62+
# directories they want to mount.
63+
VOLUME /comfyui/.venv
64+
VOLUME /comfyui/custom_nodes
65+
VOLUME /comfyui/input
66+
VOLUME /comfyui/models
67+
VOLUME /comfyui/output
68+
VOLUME /comfyui/temp
69+
VOLUME /comfyui/user
70+
VOLUME /home/comfyui
7871

7972
# Switch back to root to run the entrypoint and to install additional system
8073
# dependencies

compose.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ services:
1919
devices:
2020
- capabilities: [gpu]
2121
volumes:
22-
# Share custom nodes and models with the container.
2322
- ./custom_nodes:/comfyui/custom_nodes
2423
- ./models:/comfyui/models
25-
# Optional: mount the user data directory.
26-
#- data:/data/
24+
25+
# (Optional) Mount host ComfyUI data directories
26+
#
27+
#- ./input:/comfyui/input
28+
#- ./output:/comfyui/output
29+
#- ./temp:/comfyui/temp
30+
#- ./user:/comfyui/user
2731

2832
environment:
2933
# Overwrite the container user's UID and GID to match the host's. This

entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fi
2424
# the user's new UID and GID.
2525
echo "[entrypoint] Changing directory ownership..."
2626
chown -R "$user:$user_group" \
27-
/data \
2827
/comfyui \
2928
/home/comfyui
3029

0 commit comments

Comments
 (0)