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

29 lines
766 B
Docker
Raw Normal View History

2025-04-29 02:14:26 +02:00
FROM pytorch/pytorch:2.7.0-cuda12.8-cudnn9-runtime
2025-04-28 22:05:02 +02:00
ENV DEBIAN_FRONTEND=noninteractive
ENV PIP_PREFER_BINARY=1
ENV NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONPATH="${PYTHONPATH}:${PWD}"
ENV CLI_ARGS=""
2025-04-29 02:14:26 +02:00
WORKDIR /app
2025-04-28 23:47:23 +02:00
# Explore how we can use the CLI to do this instead
# https://docs.comfy.org/installation/system_requirements
# https://docs.comfy.org/comfy-cli/getting-started
2025-04-28 22:05:02 +02:00
RUN apt-get update && \
apt-get install -y git && \
apt-get clean && \
2025-04-29 02:14:26 +02:00
git clone --branch v0.3.30 --depth 1 https://github.com/comfyanonymous/ComfyUI.git .
2025-04-28 22:05:02 +02:00
COPY . .
2025-04-28 19:42:47 +02:00
RUN --mount=type=cache,target=/root/.cache/pip \
2025-04-28 22:05:02 +02:00
pip install -r requirements.txt && \
chmod u+x ./entrypoint.sh
EXPOSE 7860
2025-04-28 22:05:02 +02:00
ENTRYPOINT ["./entrypoint.sh"]
CMD python -u main.py --listen --port 7860 ${CLI_ARGS}