本项目包含三个层次的Docker镜像,用于构建ComfyUI运行环境:
FROM pytorch/pytorch:2.7.0-cuda12.8-cudnn9-devel # 安装基础工具 RUN apt-get update && apt-get install -y \ git git-lfs wget unzip openssh-server curl htop nload zsh \ iproute2 iputils-ping net-tools vim ca-certificates \ && apt-get clean && rm -rf /var/lib/apt/lists/* # 配置中文环境 ENV LANG=C.UTF-8 ENV LANGUAGE=C.UTF-8
功能:
FROM ccr.ccs.tencentyun.com/b-b-x.cnb/comfyui:base # 安装Node.js RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \ && apt-get install -y nodejs \ && apt-get clean && rm -rf /var/lib/apt/lists/* # 安装ComfyUI WORKDIR /opt RUN git clone https://github.com/comfyanonymous/ComfyUI.git \ && cd ComfyUI && git checkout v0.3.33 \ && pip install -r requirements.txt
功能:
FROM ccr.ccs.tencentyun.com/b-b-x.cnb/comfyui:main # 安装额外Python包 RUN pip install \ opencv-python moviepy streamlit mediapipe \ onnxruntime-gpu OpenEXR # 安装自定义节点 WORKDIR /opt/ComfyUI COPY install_custom_nodes.sh custom_nodes.conf ./ RUN ./install_custom_nodes.sh
功能:
# 构建基础镜像
docker build -f docker/1_base/Dockerfile -t ccr.ccs.tencentyun.com/b-b-x.cnb/comfyui:base .
# 构建ComfyUI基础镜像
docker build -f docker/2_comfyui/Dockerfile -t ccr.ccs.tencentyun.com/b-b-x.cnb/comfyui:main .
# 构建插件镜像
docker build -f docker/3_plugins/Dockerfile -t ccr.ccs.tencentyun.com/b-b-x.cnb/comfyui:plugins .
your-registry为您的实际镜像仓库地址install_custom_nodes.sh 安装脚本custom_nodes.conf 节点配置文件