-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (31 loc) · 1.21 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
FROM python:3.10
ARG SD_WEBUI_VERSION=v1.6.0
ENV SD_WEBUI_VERSION=${SD_WEBUI_VERSION}
RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui -b ${SD_WEBUI_VERSION} --depth 1
WORKDIR /stable-diffusion-webui
RUN apt update && \
apt-get install ffmpeg libsm6 libxext6 -y --no-install-recommends google-perftools && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
echo LD_PRELOAD=$(find /usr/lib -name libtcmalloc.so.4) >> /etc/environment
ENV venv_dir -
RUN useradd -U --home /stable-diffusion-webui sd
RUN sh -c 'nohup ./webui.sh -f --skip-torch-cuda-test --no-half >/tmp/sd.log &'; \
start=$(date +%s); \
while true; do \
sleep 3; \
if grep -q "Applying attention optimization" /tmp/sd.log; then \
break; \
elif ! ps -ef | grep -q ./webui.sh; then \
cat /tmp/sd.log; \
exit 11; \
else \
echo "[$(($(date +%s)-${start}))s] preparing..."; \
fi; \
done && \
rm -rf /root/.cache /tmp/sd.log && \
chown -R sd:sd /stable-diffusion-webui
EXPOSE 7860
USER sd
ENTRYPOINT ["/usr/local/bin/python", "/stable-diffusion-webui/webui.py"]
CMD ["--listen", "--port", "7860", "--no-download-sd-model"]