rapidocr web api service @see https://rapidai.github.io/RapidOCRDocs/
3.2K
FROM python:3.10-slim
COPY . /build
# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
# 安装必要的软件包
RUN apt-get update \
&& apt-get install -f -y g++ gcc python3-opencv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# 安装 rapidocr_web,rapidocr_api 包
RUN pip --no-cache-dir install -i https://mirrors.aliyun.com/pypi/simple --upgrade pip \
&& pip --no-cache-dir install -i https://mirrors.aliyun.com/pypi/simple rapidocr_web \
&& pip --no-cache-dir install -i https://mirrors.aliyun.com/pypi/simple rapidocr_api \
# fix bugs: numpy.float32 object is not iterable
&& sed -i '/boxes, txts, scores = list(zip(\*ocr_res))/a \ scores = [float(score) for score in scores]' /usr/local/lib/python3.10/site-packages/rapidocr_web/task.py \
&& sed -i '/return {}/a \ ocr_res = [(dt_box, rec, float(score)) for dt_box, rec, score in ocr_res]' /usr/local/lib/python3.10/site-packages/rapidocr_api/api.py
EXPOSE 9003
EXPOSE 9004
# 启动
CMD ["sh", "-c", "rapidocr_web -ip 0.0.0.0 -p 9003 & rapidocr_api -ip 0.0.0.0 -p 9004"]
Content type
Image
Digest
sha256:1de8219de…
Size
591.1 MB
Last updated
over 2 years ago
docker pull volador/rapidocr