forked from Stirling-Tools/Stirling-PDF
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
32 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,50 @@ | ||
# Main stage | ||
FROM ubuntu:latest AS base | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common gnupg2 | ||
|
||
RUN add-apt-repository ppa:alex-p/tesseract-ocr5 && apt install -y --no-install-recommends tesseract-ocr | ||
|
||
# JDK for app | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
openjdk-17-jre \ | ||
libreoffice-core-nogui \ | ||
openjdk-17-jre | ||
|
||
|
||
# Doc conversion | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libreoffice-core-nogui \ | ||
libreoffice-common \ | ||
libreoffice-writer-nogui \ | ||
libreoffice-calc-nogui \ | ||
libreoffice-impress-nogui \ | ||
python3-uno \ | ||
python3-uno \ | ||
unoconv | ||
|
||
|
||
# OCR MY PDF (unpaper for descew and other advanced featues) | ||
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common gnupg2 && \ | ||
add-apt-repository ppa:alex-p/tesseract-ocr5 && apt install -y --no-install-recommends tesseract-ocr && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
ghostscript \ | ||
python3-pip \ | ||
ocrmypdf \ | ||
unoconv && \ | ||
unpaper && \ | ||
pip install --upgrade pip && \ | ||
pip install --no-cache-dir --user --upgrade ocrmypdf && \ | ||
pip install --no-cache-dir --upgrade pillow==10.0.1 reportlab==3.6.13 wheel==0.38.1 setuptools==65.5.1 pyjwt==2.4.0 cryptography==39.0.1 \ | ||
pip install --no-cache-dir --upgrade ocrmypdf && \ | ||
pip install --no-cache-dir \ | ||
opencv-python-headless && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install --no-cache-dir --upgrade pillow==10.0.1 reportlab==3.6.13 wheel==0.38.1 setuptools==65.5.1 pyjwt==2.4.0 cryptography==39.0.1 | ||
|
||
|
||
#CV | ||
RUN pip install --no-cache-dir opencv-python-headless | ||
|
||
|
||
# cleanup and etc | ||
RUN 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 | ||
# Install build tools and Python libraries | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
zlib1g-dev \ | ||
libjpeg-dev | ||
|
||
# Final stage: Copy necessary files from the previous stage | ||
FROM base | ||
COPY --from=python-packages /usr/local /usr/local | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters