forked from qd-today/qd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.lite
65 lines (58 loc) · 2.75 KB
/
Dockerfile.lite
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
# 基础镜像
# 去除了 OCR 相关功能, 其他与 latest 版本保持一致.
# 适用于硬盘空间不大于 600M 的 Docker 构建.
FROM a76yyyy/pycurl:lite-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 sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
# ln -s /usr/bin/python3 /usr/bin/python && \
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 && \
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 --no-cache --virtual .build_deps nano cmake make perl autoconf g++ automake \
linux-headers libtool util-linux python3-dev py3-pip py3-setuptools py3-wheel && \
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
ENV QIANDAO_LITE=True
# timezone
ENV TZ=CST-8
# 添加挂载点
VOLUME ["/usr/src/app/config"]
CMD ["sh","-c","python /usr/src/app/run.py"]