GoutamSachdev's picture
Initial commit: Hybrid Vision RAG PDF Processor for HF Space
6a46e44
Raw
History Blame Contribute Delete
1.73 kB
# syntax=docker/dockerfile:1
#
# Docling PDF Processor β€” container image.
#
# Builds the Gradio demo app. Secrets (OPENROUTER_API_KEY, GROQ_API_KEY) are
# NOT baked in β€” pass them at runtime via env_file (.env) or -e flags.
#
# docker build -t docling-pdf-processor .
# docker run -p 8010:8010 --env-file .env docling-pdf-processor
#
# or use docker compose (see docker-compose.yml).
FROM python:3.11-slim AS base
# System libraries needed by Pillow / image handling on slim images.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# uv (pinned to match the lockfile produced with uv 0.7.2).
COPY --from=ghcr.io/astral-sh/uv:0.7.2 /uv /usr/local/bin/uv
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PYTHON_DOWNLOADS=never \
HF_HOME=/app/.cache/huggingface \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_SERVER_PORT=8010
# ── Dependency layer (cached unless pyproject/lock change) ────────────────
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project
# ── Application source ────────────────────────────────────────────────────
COPY docling_pdf_processor ./docling_pdf_processor
COPY main.py README.md ./
RUN uv sync --frozen --no-dev
EXPOSE 8010
# Healthcheck: Gradio serves HEAD / with 200 once ready.
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import urllib.request as u; u.urlopen('http://127.0.0.1:8010/', timeout=5)" || exit 1
CMD [".venv/bin/python", "main.py"]