forked from qd-today/qd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ja3
72 lines (65 loc) · 3.12 KB
/
Dockerfile.ja3
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
# 基础镜像
# 集成 curl-impersonate 解决 ja3 指纹被识别为 curl 的问题
# https://github.com/qd-today/qd/issues/289
# 不支持 http3 和 Quic 连接, 如需相关功能请使用 latest 版本
FROM a76yyyy/pycurl:ja3-latest
# 维护者信息
LABEL maintainer "a76yyyy <q981331502@163.com>"
LABEL org.opencontainers.image.source=https://github.com/qd-today/qd
ADD ssh/qd_fetch /root/.ssh/id_rsa
ADD ssh/qd_fetch.pub /root/.ssh/id_rsa.pub
WORKDIR /usr/src/app
# QD && Pip install modules
RUN sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories && \
apk update && 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 git@gitee.com:qd-today/qd.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 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-opencv py3-pillow && \
apk add --no-cache --virtual .build_deps cmake make perl autoconf g++ automake \
linux-headers libtool util-linux py3-pip py3-setuptools py3-wheel python3-dev py3-numpy-dev && \
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 --break-system-packages && \
apk del .build_deps && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
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"]