digisign-verification / Dockerfile
medjebril's picture
Upload folder using huggingface_hub
c5c8fec verified
Raw
History Blame Contribute Delete
985 Bytes
# syntax=docker/dockerfile:1
# Identity-verification / signature-zone detection service (FastAPI).
# OPTIONAL — started only via the docker-compose "ml" profile. Build context = this directory.
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
# System deps: OpenCV runtime libs, Tesseract OCR (MRZ/OCR), build tools for native wheels (insightface).
RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr \
libgl1 \
libglib2.0-0 \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# InsightFace / FFDNet models download on first run into INSIGHTFACE_MODEL_ROOT.
# Mount a named volume there (see docker-compose) so the download persists across restarts.
ENV INSIGHTFACE_MODEL_ROOT=/app/models \
DIGISIGN_HOST=0.0.0.0 \
DIGISIGN_PORT=8001
EXPOSE 8001
CMD ["python", "main.py"]