-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
41 lines (30 loc) · 986 Bytes
/
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
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt install -y python3.8 && \
apt-get -y install python3-pip
RUN apt-get update && apt-get -y upgrade \
&& apt-get install -y --no-install-recommends \
git \
wget \
g++ \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install diffusers transformers datasets google-cloud-storage torch==1.13.1 torchvision opencv-python xformers accelerate uvicorn fastapi
ARG model_name
ENV MODEL_NAME=$model_name
ARG use_xformers=0
ENV USE_XFORMERS=$use_xformers
ARG model_revision=main
ENV MODEL_REVISION=$model_revision
RUN echo "$MODEL_REVISION, $USE_XFORMERS, $MODEL_NAME"
WORKDIR = "/diffusion"
COPY diffusion_utils.py .
COPY load_weights.py .
RUN python3 load_weights.py
COPY main.py .
COPY entrypoint.sh .
EXPOSE 8080
ENTRYPOINT ["./entrypoint.sh"]