forked from viral-medialab/stable_diffusion_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (32 loc) · 1.54 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
44
45
46
47
48
49
50
51
FROM nvidia/cuda:11.0.3-base-ubuntu20.04
CMD nvidia-smi
# Fix Nvidia issue
RUN sh -c 'echo "APT { Get { AllowUnauthenticated \"1\"; }; };" > /etc/apt/apt.conf.d/99allow_unauth'
RUN apt -o Acquire::AllowInsecureRepositories=true -o Acquire::AllowDowngradeToInsecureRepositories=true update
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl wget gcc sudo
RUN apt-key del 7fa2af80
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
RUN dpkg -i cuda-keyring_1.0-1_all.deb
RUN rm -f /etc/apt/sources.list.d/cuda.list /etc/apt/apt.conf.d/99allow_unauth cuda-keyring_1.0-1_all.deb
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC F60F4B3D7FA2AF80
RUN apt-get update && apt-get upgrade -y
#set up environment
RUN apt-get install --no-install-recommends --no-install-suggests -y curl
RUN apt-get install unzip
RUN apt-get -y install python3.9
RUN apt-get -y install python3-pip
# Install Rust to fix Pip install issue
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -y | sh
# Install NodeJs
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
RUN sudo apt -y install nodejs
WORKDIR /stable_diffusion_server
COPY . .
RUN pip3 install -r requirements.txt
WORKDIR /stable_diffusion_server/frontend
RUN npm install --force && npm run build
WORKDIR /stable_diffusion_server
RUN python3 -c 'from huggingface_hub import HfFolder; HfFolder.save_token("<TOKEN>")'
WORKDIR /stable_diffusion_server
EXPOSE 3000
CMD [ "python3", "-u", "-m", "app"]