Spaces:
Running
Running
| FROM python:3.12-slim | |
| WORKDIR /opt/id-ocr | |
| # System deps for OpenCV and MRZ reading (tesseract) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 libglib2.0-0 \ | |
| tesseract-ocr \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| # HF Spaces runs as uid 1000 — ensure uploads dir is writable | |
| RUN mkdir -p /opt/id-ocr/uploads && chmod 777 /opt/id-ocr/uploads | |
| # Disable OneDNN/PIR to avoid unsupported op errors on HF Spaces CPUs | |
| ENV FLAGS_use_mkldnn=0 | |
| ENV FLAGS_enable_pir_api=0 | |
| ENV FLAGS_enable_pir_in_executor=0 | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "-c", "gunicorn.conf.py", "wsgi:app"] | |