-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (26 loc) · 1.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM ubuntu:22.04
LABEL org.opencontainers.image.title="Comfy-WebUI-Docker"
LABEL org.opencontainers.image.author="Cyntachs"
LABEL org.opencontainers.image.ref.name="ubuntu"
LABEL org.opencontainers.image.version="pytorch2.3.1-cuda12.1"
LABEL com.nvidia.volumes.needed="nvidia_driver"
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ="America/New_York"
ENV NVIDIA_VISIBLE_DEVICES=all PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
COPY . /workspace/
RUN --mount=type=cache,target=/var/cache/apt,rw --mount=type=cache,target=/var/lib/apt,rw --mount=type=cache,target=/root/.cache/pip set -eux; \
apt-get update; \
apt-get install --no-install-recommends -y git python3 python3-pip; \
pip3 install tzdata opencv-python glcontext; \
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121; \
pip3 install xformers opencv-python-headless; \
pip3 install -r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt; \
mkdir /stable-diffusion; \
chmod +x /workspace/entrypoint.sh; \
git config --global --add safe.directory /stable-diffusion; \
groupadd user; \
useradd user -g user -d /stable-diffusion; \
chown -R user:user /stable-diffusion;
EXPOSE 5555
USER user:user
ENTRYPOINT [ "sh" , "/workspace/entrypoint.sh" ]