forked from AUTOMATIC1111/stable-diffusion-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (35 loc) · 1.02 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
32
33
34
35
36
37
38
39
40
41
42
43
FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
LABEL org.opencontainers.image.source = "https://github.com/neuro-inc/stable-diffusion-webui"
ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 \
python3 python3-venv \
git \
wget \
vim \
inetutils-ping \
sudo \
net-tools \
iproute2 \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Prepare a non-root user
RUN adduser --system worker
WORKDIR /home/worker/app
RUN usermod -aG root worker
RUN chown -R worker:root /home/worker && \
chmod -R g+rwx /home/worker
COPY --chown=worker . .
# setup venv in /venv to avoid conflict
RUN echo 'venv_dir=/home/worker/app/venv' > webui-user.sh
ENV install_dir=/
#USER worker
RUN ./webui.sh -f can_run_as_root --exit --skip-torch-cuda-test --no-download-sd-model --do-not-download-clip
ENV VIRTUAL_ENV=/home/worker/app/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
EXPOSE 7860
EXPOSE 7861
EXPOSE 7862
CMD ["python3", "launch.py", "--listen"]