-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
89 lines (71 loc) · 2.09 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM python:3.10-slim
LABEL [email protected]
SHELL [ "/bin/bash", "-ceuxo", "pipefail" ]
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ='Asia/Shanghai'
ENV DEBAIN_FRONTEND=nointeractive PIP_PREFER_BINARY=1 PIP_NO_CACHE_DIR=1
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update -q
# https://stackoverflow.com/questions/40234847/docker-timezone-in-ubuntu-16-04-image
RUN echo $TZ > /etc/timezone && \
apt-get install -q -y --allow-unauthenticated tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
RUN --mount=type=cache,target=/var/cache/apt \
apt-get install -q -y --allow-unauthenticated --no-install-recommends \
build-essential \
ca-certificates \
ccache \
cmake \
curl \
git \
gcc \
moreutils \
fonts-dejavu-core \
libfreetype6-dev \
tk \
libjpeg-dev \
libpng-dev \
bzip2 \
ca-certificates \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
mercurial \
subversion \
wget \
vim \
libzbar-dev \
sox \
ffmpeg
RUN mkdir -p ~/.pip && echo $'\n\
[global] \n\
no-cache-dir = true \n\
index-url = http://pypi.tuna.tsinghua.edu.cn/simple \n\
trusted-host = pypi.tuna.tsinghua.edu.cn \n\
\n' > ~/.pip/pip.conf
RUN python -m pip install --upgrade pip
RUN pip install \
gradio==3.27.0 \
loguru==0.7.0 \
Pillow==9.5.0 \
numpy==1.24.3 \
pydantic==1.10.7
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 7865
ARG LOG_DIR=/web/tomcat/logs/aigc.label.com
ARG PROJECT_DIR=/web/www/aigc.label.com
RUN mkdir -p ${LOG_DIR} && \
mkdir -p ${PROJECT_DIR}
WORKDIR ${PROJECT_DIR}
COPY . ${PROJECT_DIR}
RUN echo $'#!/bin/bash \n\
set -euxo pipefail \n\
python ui.py "$@" & \n\
tail -f /dev/null' > /usr/bin/start_entrypoint.sh \
&& chmod +x /usr/bin/start_entrypoint.sh
ENTRYPOINT ["/usr/bin/start_entrypoint.sh"]