chore: 优化 ComfyUI Docker 配置

- .dockerignore: 精简忽略规则
- config.toml: 添加 [comfyui] 配置段
- Dockerfile: 本地源码构建、清华镜像加速
This commit is contained in:
boos
2026-05-19 02:33:23 +08:00
parent ba07517974
commit c9e98df3f1
3 changed files with 26 additions and 12 deletions
+13 -3
View File
@@ -2,22 +2,32 @@ FROM python:3.11-slim
WORKDIR /workspace
# Use USTC mirror for faster apt
RUN sed -i 's|deb.debian.org|mirrors.ustc.edu.cn|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
sed -i 's|deb.debian.org|mirrors.ustc.edu.cn|g' /etc/apt/sources.list
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl \
&& rm -rf /var/lib/apt/lists/*
# Clone ComfyUI
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /workspace/ComfyUI
# Copy ComfyUI from local source (avoid slow GitHub clone)
COPY comfy_source /workspace/ComfyUI
WORKDIR /workspace/ComfyUI
# Install git (needed for some ComfyUI custom node managers)
RUN git init
# Python venv + deps (CPU-only, generation goes through BoosAPI)
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install --upgrade pip && \
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
pip config set global.extra-index-url https://download.pytorch.org/whl/cpu && \
pip install torch torchvision torchaudio && \
grep -v kornia_rs requirements.txt | pip install -r /dev/stdin && \
pip install six && \
rm -rf ~/.cache/pip
ENV PATH="/workspace/ComfyUI/venv/bin:${PATH}"