38 lines
916 B
Docker
38 lines
916 B
Docker
FROM ubuntu:24.04
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
sane-utils \
|
|
imagemagick \
|
|
poppler-utils \
|
|
tesseract-ocr \
|
|
tesseract-ocr-deu \
|
|
tesseract-ocr-eng \
|
|
unpaper \
|
|
bc \
|
|
python3 \
|
|
python3-pip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Allow ImageMagick to process PDF files
|
|
RUN sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' \
|
|
/etc/ImageMagick-6/policy.xml || true
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt
|
|
|
|
COPY scan.sh .
|
|
RUN chmod +x scan.sh
|
|
|
|
COPY api/ api/
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
|
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/status')" || exit 1
|
|
|
|
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|