-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
48 lines (39 loc) · 1.24 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
FROM ubuntu:22.04
LABEL maintainer="Stability AI"
ENV MODEL_NAME="stabilityai/sdxl-turbo"
ENV SERVING_PORT=8080
ENV PYTHONUNBUFFERED=1
ENV SAVE_PATH="/opt/model"
COPY requirements.txt /opt/
COPY prepare_huggingface_data.py /opt/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
gnupg2 \
wget \
python3-pip \
python3-dev \
python3-setuptools \
gcc \
&& cd /usr/local/bin \
&& pip3 --no-cache-dir install --upgrade pip \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Update PATH so that the serve programs are found when the container is invoked.
ENV PATH="/opt/:${PATH}"
WORKDIR /opt
# install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install torch
RUN python3 prepare_huggingface_data.py
# copy the code and requirements
COPY entrypoint.py /opt/
COPY sdxl_turbo.py /opt/
EXPOSE $SERVING_PORT
ENTRYPOINT ["sh", "-c", "python3 entrypoint.py $SERVING_PORT"]
# Label image
ARG GIT_BRANCH
ARG GIT_COMMIT
LABEL org.opencontainers.image.source https://github.com/Stability-AI/marketplace-containers
LABEL org.opencontainers.image.version $GIT_BRANCH
LABEL org.opencontainers.image.revision $GIT_COMMIT
LABEL org.opencontainers.image.vendor "Stability AI"