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/* # 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 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}" EXPOSE 8188 CMD ["python3", "main.py", "--listen", "0.0.0.0", "--port", "8188", "--cpu"]