mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-26 22:30:19 +08:00
Install extra system dependencies at build-time
This commit is contained in:
parent
847e3cc3a2
commit
4f12985e45
28
Dockerfile
28
Dockerfile
@ -9,11 +9,10 @@
|
|||||||
# Use the recommended Python version 3.12, as specified in the README.
|
# Use the recommended Python version 3.12, as specified in the README.
|
||||||
FROM python:3.12.11-bookworm AS comfyui-base
|
FROM python:3.12.11-bookworm AS comfyui-base
|
||||||
|
|
||||||
|
ARG APT_EXTRA_PACKAGES
|
||||||
|
|
||||||
# Install cmake, which is an indirect installation dependencies
|
# Install cmake, which is an indirect installation dependencies
|
||||||
RUN apt update \
|
RUN apt update && apt install -y --no-install-recommends cmake
|
||||||
&& apt install -y --no-install-recommends cmake \
|
|
||||||
&& apt clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Create a mount point for user-generated data.
|
# Create a mount point for user-generated data.
|
||||||
RUN mkdir -p \
|
RUN mkdir -p \
|
||||||
@ -67,19 +66,16 @@ EXPOSE 8188
|
|||||||
# virtual environment and into the user’s home directory.
|
# virtual environment and into the user’s home directory.
|
||||||
VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/comfyui/models", "/home/comfyui" ]
|
VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/comfyui/models", "/home/comfyui" ]
|
||||||
|
|
||||||
# Switch back to root to run the entrypoint and ensure it is executable.
|
# Switch back to root to run the entrypoint and to install additional system
|
||||||
|
# dependencies
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
# Install additional system dependencies
|
||||||
|
RUN apt install -y --no-install-recommends $APT_EXTRA_PACKAGES \
|
||||||
|
&& apt clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Configure entrypoint
|
||||||
RUN chmod +x entrypoint.sh
|
RUN chmod +x entrypoint.sh
|
||||||
ENTRYPOINT [ "./entrypoint.sh" ]
|
ENTRYPOINT [ "./entrypoint.sh" ]
|
||||||
CMD [ "python", "./main.py" ]
|
CMD [ "python", "./main.py" ]
|
||||||
|
|
||||||
# Known issue: Some custom nodes require additional system dependencies, which
|
|
||||||
# are not as easy to install as Python dependencies. If this is the case, you
|
|
||||||
# can use the instruction below to install the required packages.
|
|
||||||
#RUN apt update \
|
|
||||||
# && apt install -y --no-install-recommends \
|
|
||||||
# package-1 \
|
|
||||||
# package-2 \
|
|
||||||
# ... \
|
|
||||||
# && apt clean \
|
|
||||||
# && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|||||||
@ -7,7 +7,11 @@
|
|||||||
services:
|
services:
|
||||||
comfyui:
|
comfyui:
|
||||||
container_name: comfyui
|
container_name: comfyui
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
# Declare additional system dependencies for custom nodes
|
||||||
|
APT_EXTRA_PACKAGES:
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:8188:8188
|
- 127.0.0.1:8188:8188
|
||||||
@ -34,7 +38,7 @@ services:
|
|||||||
# Declare additional Python packages to install. Useful when a custom node
|
# Declare additional Python packages to install. Useful when a custom node
|
||||||
# pack does not properly specify all its dependencies or relies on
|
# pack does not properly specify all its dependencies or relies on
|
||||||
# optional dependencies.
|
# optional dependencies.
|
||||||
#PIP_EXTRA_PACKAGES:
|
PIP_EXTRA_PACKAGES:
|
||||||
|
|
||||||
# Optional: Override the default command. In this case, configure ComfyUI to
|
# Optional: Override the default command. In this case, configure ComfyUI to
|
||||||
# listen on all network interfaces (which is required when not using
|
# listen on all network interfaces (which is required when not using
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user