2023-05-01 22:57:48 +02:00
|
|
|
# Main stage
|
2023-06-08 21:25:55 +02:00
|
|
|
FROM bellsoft/liberica-openjdk-debian:17 AS base
|
2023-04-15 22:17:47 +02:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2023-05-18 00:58:15 +02:00
|
|
|
libreoffice-core-nogui \
|
2023-04-15 22:17:47 +02:00
|
|
|
libreoffice-common \
|
2023-05-18 00:58:15 +02:00
|
|
|
libreoffice-writer-nogui \
|
|
|
|
libreoffice-calc-nogui \
|
|
|
|
libreoffice-impress-nogui \
|
2023-04-15 22:17:47 +02:00
|
|
|
python3-uno \
|
2023-05-01 22:57:48 +02:00
|
|
|
python3-pip \
|
2023-04-15 22:17:47 +02:00
|
|
|
unoconv \
|
2023-05-01 22:57:48 +02:00
|
|
|
pngquant \
|
|
|
|
unpaper \
|
2023-04-15 22:17:47 +02:00
|
|
|
ocrmypdf && \
|
2023-05-01 22:57:48 +02:00
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
mkdir /usr/share/tesseract-ocr-original && \
|
|
|
|
cp -r /usr/share/tesseract-ocr/* /usr/share/tesseract-ocr-original && \
|
|
|
|
rm -rf /usr/share/tesseract-ocr
|
|
|
|
|
|
|
|
# Python packages stage
|
|
|
|
FROM base AS python-packages
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
build-essential \
|
|
|
|
libffi-dev \
|
|
|
|
libssl-dev \
|
|
|
|
zlib1g-dev \
|
|
|
|
libjpeg-dev && \
|
|
|
|
pip install --upgrade pip && \
|
|
|
|
pip install --no-cache-dir \
|
|
|
|
opencv-python-headless && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-04-15 22:17:47 +02:00
|
|
|
|
2023-05-01 22:57:48 +02:00
|
|
|
# Final stage: Copy necessary files from the previous stage
|
|
|
|
FROM base
|
2023-05-20 00:58:54 +02:00
|
|
|
COPY --from=python-packages /usr/local /usr/local
|