Extraction_validate / Dockerfile
Monike123's picture
feat: gemini-3-flash 5-key pool, hyper-granular prompts, updated Dockerfile for HF Spaces
0a78fb1
Raw
History Blame Contribute Delete
2.03 kB
FROM python:3.11-slim
# ── Labels required by HF Spaces ──────────────────────────────────────────
LABEL maintainer="Monike123"
LABEL description="DocVerify AI β€” HR Document Verification & Extraction"
WORKDIR /app
# ── System dependencies ────────────────────────────────────────────────────
# libgl1 + libglib2.0-0 β†’ OpenCV
# poppler-utils β†’ pdf2image (PDF β†’ PNG rendering)
# libgomp1 β†’ EasyOCR threading
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 libgomp1 \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# ── Python dependencies (cached layer β€” only rebuilds on requirements change) ──
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# ── Application code ──────────────────────────────────────────────────────
COPY . .
# ── Runtime directories ────────────────────────────────────────────────────
RUN mkdir -p temp_uploads masked_output original_uploads ocr_models
# ── HF Spaces: port MUST be 7860 ──────────────────────────────────────────
EXPOSE 7860
# ── Start server ──────────────────────────────────────────────────────────
# Workers=1 keeps RAM under 8GB HF free limit (EasyOCR alone is ~1.5GB)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]