Spaces:
Sleeping
Sleeping
Download Dockerfile from haloger/Receipt-OCR: direct link, hf CLI and curl.
- Browser
- Download file 850 Bytes
-
https://huggingface.co/spaces/haloger/Receipt-OCR/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/haloger/Receipt-OCR/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/haloger/Receipt-OCR/resolve/main/Dockerfile
850 Bytes
| FROM python:3.9-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 1. 安装系统依赖(poppler 和 tesseract OCR + 中文字体) | |
| RUN apt-get update && apt-get install -y \ | |
| poppler-utils \ | |
| tesseract-ocr \ | |
| tesseract-ocr-chi-sim \ | |
| libgl1 \ | |
| fonts-noto-cjk \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. 复制依赖文件 | |
| COPY backend/requirements.txt /app/requirements.txt | |
| # 3. 安装 Python 依赖 | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 4. 复制应用代码 | |
| COPY backend/app /app/app | |
| # 5. 创建临时存储目录 | |
| RUN mkdir -p /app/storage /app/temp_uploads && chmod 777 /app/storage /app/temp_uploads | |
| # 6. 设置环境变量 | |
| ENV INVOICE_WEB_STORAGE=/app/storage | |
| ENV PYTHONUNBUFFERED=1 | |
| # 7. 启动命令(Hugging Face Spaces 默认端口 7860) | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |