stable-diffusion-webui-docker/services/comfy/Dockerfile

39 lines
1.1 KiB
Docker
Raw Normal View History

FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
2025-10-06 11:23:17 +02:00
ENV DEBIAN_FRONTEND=noninteractive
ENV PIP_PREFER_BINARY=1
2025-10-06 10:57:35 +02:00
RUN apt-get update && apt-get install -y git && \
apt --fix-broken install -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV ROOT=/stable-diffusion
2025-10-06 10:57:35 +02:00
WORKDIR /stable-diffusion
RUN --mount=type=cache,target=/root/.cache/pip \
2025-10-06 10:57:35 +02:00
git clone https://github.com/comfyanonymous/ComfyUI.git ${ROOT} && \
cd ${ROOT} && \
2025-10-06 11:24:20 +02:00
# git checkout master && \
2025-10-06 10:57:35 +02:00
pip install -r requirements.txt
2025-10-06 11:10:18 +02:00
WORKDIR /stable-diffusion/custom_nodes
2025-10-06 11:23:17 +02:00
RUN git clone https://github.com/Comfy-Org/ComfyUI-Manager.git && \
2025-10-06 11:10:18 +02:00
cd ComfyUI-Manager && \
2025-10-06 11:24:20 +02:00
# git checkout master && \
2025-10-06 10:57:35 +02:00
pip install -r requirements.txt
WORKDIR ${ROOT}
COPY . /docker/
RUN chmod u+x /docker/entrypoint.sh && cp /docker/extra_model_paths.yaml ${ROOT}
2025-10-06 10:57:35 +02:00
ENV NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONPATH="${PYTHONPATH}:${PWD}"
2025-10-06 11:57:57 +02:00
ENV CLI_ARGS="--listen 0.0.0.0 --port 7860"
2025-10-06 10:57:35 +02:00
EXPOSE 7860
2025-10-06 10:57:35 +02:00
ENTRYPOINT ["/docker/entrypoint.sh"]
2025-10-06 10:57:35 +02:00
2025-10-06 11:57:57 +02:00
# CMD ["python", "-u", "main.py", "--listen", "--port", "7860", "${CLI_ARGS}"]
CMD ["python", "-u", "main.py", "--listen", "0.0.0.0", "--port", "7860"]