camenduru chris-rannou HF staff commited on
Commit
948b99c
1 Parent(s): 5131a20

Optimize dockerfile image (#28)

Browse files

- Optimize dockerfile image (6535286d78bb83b5fa7d507e335e260aa26097ac)


Co-authored-by: Christophe Rannou <[email protected]>

Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -4,6 +4,10 @@
4
  FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
5
  ENV DEBIAN_FRONTEND noninteractive
6
 
 
 
 
 
7
  WORKDIR /content
8
 
9
  RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && pip3 install --upgrade pip
@@ -17,9 +21,9 @@ RUN sed -i -e '''/prepare_environment()/a\ os.system\(f\"""sed -i -e ''\"s/di
17
  RUN sed -i -e 's/ start()/ #start()/g' /content/stable-diffusion-webui/launch.py
18
  RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
19
 
20
- ADD https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py
21
  RUN sed -i -e '/import image_from_url_text/r /content/env_patch.py' /content/stable-diffusion-webui/modules/ui.py
22
- ADD https://github.com/camenduru/webui-docker/raw/main/header_patch.py /content/header_patch.py
23
  RUN sed -i -e '/demo:/r /content/header_patch.py' /content/stable-diffusion-webui/modules/ui.py
24
 
25
  RUN sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /content/stable-diffusion-webui/modules/ui.py
@@ -34,15 +38,10 @@ RUN sed -i -e 's/ queue=False, / /g' /content/stab
34
 
35
  RUN rm -rfv /content/stable-diffusion-webui/scripts/
36
 
37
- ADD https://github.com/camenduru/webui-docker/raw/main/shared-config.json /content/shared-config.json
38
- ADD https://github.com/camenduru/webui-docker/raw/main/shared-ui-config.json /content/shared-ui-config.json
39
 
40
- ADD https://huggingface.co/ckpt/anything-v4.5-vae-swapped/resolve/main/anything-v4.5-vae-swapped.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-vae-swapped.safetensors
41
-
42
- RUN adduser --disabled-password --gecos '' user
43
- RUN chown -R user:user /content
44
- RUN chmod -R 777 /content
45
- USER user
46
 
47
  EXPOSE 7860
48
 
 
4
  FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
5
  ENV DEBIAN_FRONTEND noninteractive
6
 
7
+
8
+ RUN adduser --disabled-password --gecos '' user
9
+ USER user
10
+
11
  WORKDIR /content
12
 
13
  RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && pip3 install --upgrade pip
 
21
  RUN sed -i -e 's/ start()/ #start()/g' /content/stable-diffusion-webui/launch.py
22
  RUN cd stable-diffusion-webui && python launch.py --skip-torch-cuda-test
23
 
24
+ ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py
25
  RUN sed -i -e '/import image_from_url_text/r /content/env_patch.py' /content/stable-diffusion-webui/modules/ui.py
26
+ ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/header_patch.py /content/header_patch.py
27
  RUN sed -i -e '/demo:/r /content/header_patch.py' /content/stable-diffusion-webui/modules/ui.py
28
 
29
  RUN sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /content/stable-diffusion-webui/modules/ui.py
 
38
 
39
  RUN rm -rfv /content/stable-diffusion-webui/scripts/
40
 
41
+ ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/shared-config.json /content/shared-config.json
42
+ ADD --chown=user https://github.com/camenduru/webui-docker/raw/main/shared-ui-config.json /content/shared-ui-config.json
43
 
44
+ ADD --chown=user https://huggingface.co/ckpt/anything-v4.5-vae-swapped/resolve/main/anything-v4.5-vae-swapped.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-vae-swapped.safetensors
 
 
 
 
 
45
 
46
  EXPOSE 7860
47