forked from qd-today/qd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (63 loc) · 2.77 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
# 基础镜像
FROM a76yyyy/pycurl:latest
# 维护者信息
LABEL maintainer "a76yyyy <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/qiandao-today/qiandao
ADD ssh/qiandao_fetch /root/.ssh/id_rsa
ADD ssh/qiandao_fetch.pub /root/.ssh/id_rsa.pub
WORKDIR /usr/src/app
# Qiandao && Pip install modules
RUN apk add --update --no-cache openssh-client && \
chmod 600 /root/.ssh/id_rsa && \
ssh-keyscan gitee.com > /root/.ssh/known_hosts && \
let num=$RANDOM%100+10 && \
sleep $num && \
git clone --depth 1 [email protected]:a76yyyy/qiandao.git /gitclone_tmp && \
yes | cp -rf /gitclone_tmp/. /usr/src/app && \
rm -rf /gitclone_tmp && \
chmod +x /usr/src/app/update.sh && \
ln -s /usr/src/app/update.sh /bin/update && \
apk add --update --no-cache openssh-client python3 py3-six \
py3-markupsafe py3-pycryptodome py3-tornado py3-wrapt \
py3-packaging py3-greenlet py3-urllib3 py3-cryptography \
py3-aiosignal py3-async-timeout py3-attrs py3-frozenlist \
py3-multidict py3-charset-normalizer py3-aiohttp \
py3-typing-extensions py3-yarl && \
[[ $(getconf LONG_BIT) = "32" ]] && \
echo "Tips: 32-bit systems do not support ddddocr, so there is no need to install numpy and opencv-python" || \
apk add --update --no-cache py3-numpy-dev py3-opencv py3-pillow && \
apk add --no-cache --virtual .build_deps cmake make perl \
autoconf g++ automake py3-pip py3-setuptools py3-wheel python3-dev \
linux-headers libtool util-linux && \
sed -i '/ddddocr/d' requirements.txt && \
sed -i '/packaging/d' requirements.txt && \
sed -i '/wrapt/d' requirements.txt && \
sed -i '/pycryptodome/d' requirements.txt && \
sed -i '/tornado/d' requirements.txt && \
sed -i '/MarkupSafe/d' requirements.txt && \
sed -i '/pillow/d' requirements.txt && \
sed -i '/opencv/d' requirements.txt && \
sed -i '/numpy/d' requirements.txt && \
sed -i '/greenlet/d' requirements.txt && \
sed -i '/urllib3/d' requirements.txt && \
sed -i '/cryptography/d' requirements.txt && \
sed -i '/aiosignal/d' requirements.txt && \
sed -i '/async-timeout/d' requirements.txt && \
sed -i '/attrs/d' requirements.txt && \
sed -i '/frozenlist/d' requirements.txt && \
sed -i '/multidict/d' requirements.txt && \
sed -i '/charset-normalizer/d' requirements.txt && \
sed -i '/aiohttp/d' requirements.txt && \
sed -i '/typing-extensions/d' requirements.txt && \
sed -i '/yarl/d' requirements.txt && \
pip install --no-cache-dir -r requirements.txt && \
apk del .build_deps && \
rm -rf /var/cache/apk/* && \
rm -rf /usr/share/man/*
ENV PORT 80
EXPOSE $PORT/tcp
# timezone
ENV TZ=CST-8
# 添加挂载点
VOLUME ["/usr/src/app/config"]
CMD ["sh","-c","python /usr/src/app/run.py"]