| FROM python:3.9-slim | |
| # Install system dependencies (Poppler for pdf2image + Tesseract for OCR) | |
| RUN apt-get update && apt-get install -y \ | |
| poppler-utils \ | |
| tesseract-ocr \ | |
| tesseract-ocr-hin \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code and model | |
| COPY . . | |
| # Expose port (Hugging Face Spaces uses 7860 by default) | |
| EXPOSE 7860 | |
| # Run the app using python -m uvicorn | |
| CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |