docling: containerized docling-serve without UI; preseed EasyOCR models; expose v1 API on 7860
6ad2801
| FROM ghcr.io/docling-project/docling-serve-cu128:main | |
| ENV DOCLING_SERVE_ENABLE_UI=false \ | |
| UVICORN_PORT=7860 \ | |
| OMP_NUM_THREADS=4 | |
| # Pre-seed EasyOCR models into Docling cache to avoid download issues | |
| RUN mkdir -p /opt/app-root/src/.cache/docling/models/EasyOcr && \ | |
| curl -L --fail --retry 5 --retry-connrefused -o /opt/app-root/src/.cache/docling/models/EasyOcr/craft_mlt_25k.pth \ | |
| https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/craft_mlt_25k.pth && \ | |
| curl -L --fail --retry 5 --retry-connrefused -o /opt/app-root/src/.cache/docling/models/EasyOcr/english_g2.pth \ | |
| https://github.com/JaidedAI/EasyOCR/releases/download/v1.6.2/english_g2.pth | |
| EXPOSE 7860 | |
| # Healthcheck on API docs | |
| HEALTHCHECK --interval=20s --timeout=5s --start-period=15s --retries=5 \ | |
| CMD sh -lc 'curl -fsS http://127.0.0.1:${UVICORN_PORT}/docs >/dev/null || exit 1' | |
| ENTRYPOINT [] | |
| CMD ["docling-serve", "run", "--host", "0.0.0.0", "--port", "7860"] |