| |
| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| libgl1 \ |
| libglib2.0-0 \ |
| libgomp1 \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY app.py . |
|
|
| |
| RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download('monkt/paddleocr-onnx', 'detection/v5/det.onnx'); hf_hub_download('monkt/paddleocr-onnx', 'languages/english/rec.onnx'); hf_hub_download('monkt/paddleocr-onnx', 'languages/english/dict.txt'); print('PP-OCRv5 ONNX models downloaded')" |
|
|
| EXPOSE 7860 |
|
|
| HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ |
| CMD curl -f http://localhost:7860/ || exit 1 |
|
|
| CMD ["python", "app.py"] |
|
|