mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 21:00:16 +08:00
Split data volume
This commit is contained in:
parent
7795a4e86c
commit
fa71050a07
31
Dockerfile
31
Dockerfile
@ -14,13 +14,6 @@ FROM python:3.12.12-trixie
|
|||||||
# Install cmake, which is an indirect installation dependencies
|
# Install cmake, which is an indirect installation dependencies
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends cmake
|
RUN apt-get update && apt-get install -y --no-install-recommends cmake
|
||||||
|
|
||||||
# Create a mount point for user-generated data.
|
|
||||||
RUN mkdir -p \
|
|
||||||
/data/input \
|
|
||||||
/data/output \
|
|
||||||
/data/temp \
|
|
||||||
/data/user
|
|
||||||
|
|
||||||
# Create a regular user whose UID and GID will match the host user's at runtime.
|
# Create a regular user whose UID and GID will match the host user's at runtime.
|
||||||
# Also create a home directory for this user (-m), as some common Python tools
|
# Also create a home directory for this user (-m), as some common Python tools
|
||||||
# (such as uv) interact with the user’s home directory.
|
# (such as uv) interact with the user’s home directory.
|
||||||
@ -57,24 +50,24 @@ COPY requirements.txt manager_requirements.txt ./
|
|||||||
RUN pip install --no-cache-dir --disable-pip-version-check \
|
RUN pip install --no-cache-dir --disable-pip-version-check \
|
||||||
-r requirements.txt
|
-r requirements.txt
|
||||||
|
|
||||||
# Install ComfyUI and link the data mount points.
|
# Install ComfyUI
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN ln -sf /data/* .
|
|
||||||
|
|
||||||
# Purely declarative: inform Docker and image users that this image is designed
|
# Purely declarative: inform Docker and image users that this image is designed
|
||||||
# to listen on port 8188 for the web GUI.
|
# to listen on port 8188 for the web GUI.
|
||||||
EXPOSE 8188
|
EXPOSE 8188
|
||||||
|
|
||||||
# Declare persistent volumes:
|
# Declare persistent volumes. We assign one volume per data directory to match
|
||||||
# - /data: stores user-generated data from ComfyUI,
|
# ComfyUI’s natural file layout and to let users selectively choose which
|
||||||
# - /comfyui/.venv: stores Python data generated by the entrypoint and custom
|
# directories they want to mount.
|
||||||
# node managers,
|
VOLUME /comfyui/.venv
|
||||||
# - /comfyui/custom_nodes: stores custom nodes installed at runtime by custom
|
VOLUME /comfyui/custom_nodes
|
||||||
# node managers,
|
VOLUME /comfyui/input
|
||||||
# - /comfyui/models: Stores models installed by model managers,
|
VOLUME /comfyui/models
|
||||||
# - /home/comfyui: stores data from Python packages that may write outside the
|
VOLUME /comfyui/output
|
||||||
# virtual environment and into the user’s home directory.
|
VOLUME /comfyui/temp
|
||||||
VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/comfyui/models", "/home/comfyui" ]
|
VOLUME /comfyui/user
|
||||||
|
VOLUME /home/comfyui
|
||||||
|
|
||||||
# Switch back to root to run the entrypoint and to install additional system
|
# Switch back to root to run the entrypoint and to install additional system
|
||||||
# dependencies
|
# dependencies
|
||||||
|
|||||||
10
compose.yaml
10
compose.yaml
@ -19,11 +19,15 @@ services:
|
|||||||
devices:
|
devices:
|
||||||
- capabilities: [gpu]
|
- capabilities: [gpu]
|
||||||
volumes:
|
volumes:
|
||||||
# Share custom nodes and models with the container.
|
|
||||||
- ./custom_nodes:/comfyui/custom_nodes
|
- ./custom_nodes:/comfyui/custom_nodes
|
||||||
- ./models:/comfyui/models
|
- ./models:/comfyui/models
|
||||||
# Optional: mount the user data directory.
|
|
||||||
#- data:/data/
|
# (Optional) Mount host ComfyUI data directories
|
||||||
|
#
|
||||||
|
#- ./input:/comfyui/input
|
||||||
|
#- ./output:/comfyui/output
|
||||||
|
#- ./temp:/comfyui/temp
|
||||||
|
#- ./user:/comfyui/user
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
# Overwrite the container user's UID and GID to match the host's. This
|
# Overwrite the container user's UID and GID to match the host's. This
|
||||||
|
|||||||
@ -24,7 +24,6 @@ fi
|
|||||||
# the user's new UID and GID.
|
# the user's new UID and GID.
|
||||||
echo "[entrypoint] Changing directory ownership..."
|
echo "[entrypoint] Changing directory ownership..."
|
||||||
chown -R "$user:$user_group" \
|
chown -R "$user:$user_group" \
|
||||||
/data \
|
|
||||||
/comfyui \
|
/comfyui \
|
||||||
/home/comfyui
|
/home/comfyui
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user