HG-ha / ICP_Query

ICP备案查询,从工业和信息化部政务服务平台抓取实时数据,提供本地API,自动过验证码,支持Web、APP、小程序、快应用名称查询,违法违规应用查询,支持根据备案号查询,支持根据企业名称查询
https://hg-ha.github.io/app/icpb
271 stars 48 forks source link

大佬能分享 Dockerfile 吗? #7

Open stilleshan opened 7 months ago

stilleshan commented 7 months ago

尝试自己写了下 dockerfile,可以正常启动访问,但是使用一直提示 Cannot serialize non-str key False。 是有限制吗?还是说 docker 版不开源?

FROM python:3.8.18-slim-bullseye

WORKDIR /

ENV TZ=Asia/Shanghai

# Install necessary packages for building and running your application, including libglib2.0-0
RUN apt-get update -y && apt-get install -y \
    gcc \
    make \
    python3-dev \
    wget \
    unzip \
    libgl1-mesa-glx \
    libglib2.0-0 \
    && wget https://github.com/HG-ha/ICP_Query/raw/main/2023-12-9_auto_icp-Api.zip \
    && unzip 2023-12-9_auto_icp-Api.zip && cd icp_Api \
    && pip install --upgrade pip \
    && pip install -r requirements.txt -i https://mirror.baidu.com/pypi/simple \
    && sed -i 's/127.0.0.1/0.0.0.0/g' /icp_Api/icpApi.py

CMD ["python", "/icp_Api/icpApi.py"]
HG-ha commented 7 months ago

已上传

stilleshan commented 7 months ago

两个小问题

Dockerfile

Dockerfile 路径错了,应该为:ADD . /icp_Api

另外就是 icpApi.py 里的 host = "127.0.0.1", 限制了无法通过容器外部访问,改为0.0.0.0才行。即使 -p 0.0.0.0:16181:16181 也无法访问。

测试错误

curl http://127.0.0.1:16181/query/web?search=baidu.com
curl: (52) Empty reply from server

查看日志如下

        请根据 isma.jpg 依次点击窗口中的汉字

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.
HG-ha commented 7 months ago

你下错包了