2024-05-20 14:44:41 +02:00
|
|
|
FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
|
2023-04-21 21:34:17 +02:00
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y git && apt-get clean
|
|
|
|
|
|
2025-04-28 19:42:47 +02:00
|
|
|
# Set USER here? https://stackoverflow.com/questions/24549746/switching-users-inside-docker-image-to-a-non-root-user
|
|
|
|
|
# USER ${uid}:${gid}
|
|
|
|
|
|
|
|
|
|
# RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
|
# put Cache somehwere else or don't define target?
|
|
|
|
|
# PIP_CACHE_DIR pip cache dir
|
|
|
|
|
|
2023-04-21 21:34:17 +02:00
|
|
|
ENV ROOT=/stable-diffusion
|
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
|
|
|
git clone https://github.com/comfyanonymous/ComfyUI.git ${ROOT} && \
|
|
|
|
|
cd ${ROOT} && \
|
2025-04-28 19:42:47 +02:00
|
|
|
git checkout v0.3.19 && \
|
2023-04-21 21:34:17 +02:00
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
WORKDIR ${ROOT}
|
|
|
|
|
COPY . /docker/
|
2024-01-01 11:04:02 +01:00
|
|
|
RUN chmod u+x /docker/entrypoint.sh && cp /docker/extra_model_paths.yaml ${ROOT}
|
2023-04-21 21:34:17 +02:00
|
|
|
|
2024-01-01 11:04:02 +01:00
|
|
|
ENV NVIDIA_VISIBLE_DEVICES=all PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
|
2023-04-21 21:34:17 +02:00
|
|
|
EXPOSE 7860
|
|
|
|
|
ENTRYPOINT ["/docker/entrypoint.sh"]
|
2025-03-21 01:38:33 +01:00
|
|
|
CMD python -u main.py --listen --port 7860 ${CLI_ARGS}
|