Skip to content

docker如何将模型数据完全离线映射? #541

@knight-666

Description

@knight-666

dockerfile

FROM python:3.10.11-slim-buster
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
RUN pip install --no-cache-dir onnxruntime rapidocr_api -i https://mirrors.aliyun.com/pypi/simple
RUN pip uninstall -y opencv-python && \
    pip install --no-cache-dir opencv-python-headless -i https://mirrors.aliyun.com/pypi/simple
EXPOSE 9005
CMD ["bash", "-c", "rapidocr_api -ip 0.0.0.0 -p 9005 -workers 2"]

docker启动之后,在ocr识别时会通过网络下载RapidAI/RapidOCR/resources/fonts/*.ttf 导致无法完全离线使用
是否可以在启动docker容器时,将这些模型数据通过映射的方式使用,可以手动更新模型或者字体之类的数据

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions