| # 使用官方 Python 轻量镜像 | |
| FROM python:3.10-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 1. 安装系统依赖和 uv (用于快速安装 python 包) | |
| RUN apt-get update && apt-get install -y git curl && \ | |
| pip install --no-cache-dir uv | |
| # 2. 安装 Python 依赖 | |
| # - fastapi, uvicorn, sse-starlette: 用于构建 Web 服务器 | |
| # - paddleocr-mcp: 你的核心 OCR 工具包 | |
| RUN uv pip install --system fastapi uvicorn sse-starlette paddleocr-mcp | |
| # 3. 复制服务器代码 | |
| COPY server.py . | |
| # 4. 暴露端口 (Hugging Face 默认端口) | |
| EXPOSE 7860 | |
| # 5. 启动服务 | |
| CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] |