Files
PicAnalysis/paddleocr/Dockerfile
congsh 9a301cc434 feat(ocr): 集成 PaddleOCR 服务并优化 OCR 系统
- 新增 PaddleOCR 本地高精度 OCR 服务支持,包括 Dockerfile、API 服务和 provider 实现
- 在 docker-compose 中集成 RapidOCR 和 PaddleOCR 服务,并配置健康检查
- 优化后端 API 路由前缀,移除 `/api` 以简化代理配置
- 更新 Nginx 配置以正确传递请求头和代理 WebSocket 连接
- 在前端设置页面添加 PaddleOCR 和 RapidOCR 的测试与配置选项
- 修复后端 Dockerfile 以支持 Python 原生模块构建
- 更新 OCR 设置指南,反映当前服务状态和部署方式
- 添加上传文件调试日志和权限设置
2026-02-27 18:43:07 +08:00

43 lines
970 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PaddleOCR Service Dockerfile
# 从 Python 基础镜像构建,避免 CPU 指令集兼容性问题
FROM python:3.10-slim
WORKDIR /app
# 安装系统依赖(使用新的包名适配 Debian Trixie
RUN apt-get update && apt-get install -y \
libgomp1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgl1 \
git \
wget \
&& rm -rf /var/lib/apt/lists/*
# 复制 requirements
COPY requirements.txt .
# 安装 Python 依赖
# 使用 pip 安装的 PaddlePaddle 会自动适配 CPU 指令集
RUN pip install --no-cache-dir paddlepaddle==2.6.0 \
&& pip install --no-cache-dir -r requirements.txt
# 克隆 PaddleOCR 仓库
RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git /PaddleOCR
# 设置环境
ENV PYTHONPATH=/PaddleOCR:$PYTHONPATH
ENV HOME=/root
# 复制 API 服务代码
COPY paddleocr_api.py /app/paddleocr_api.py
# 暴露端口
EXPOSE 8866
# 启动 API 服务
CMD ["python", "/app/paddleocr_api.py"]