File size: 2,028 Bytes
0e39d80
 
0a78fb1
 
 
 
0e39d80
 
0a78fb1
 
 
 
0e39d80
0a78fb1
 
0e39d80
 
0a78fb1
0e39d80
0a78fb1
 
0e39d80
0a78fb1
0e39d80
 
0a78fb1
0e39d80
 
0a78fb1
0e39d80
 
0a78fb1
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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"]