加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile.ja3 3.17 KB
一键复制 编辑 原始数据 按行查看 历史
a76yyyy 提交于 2023-11-12 15:46 . Build(docker): 🏗️ 修复 cffi 构建
# 基础镜像
# 集成 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 py3-cffi && \
[[ $(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 && \
sed -i '/cffi/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"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化