nbugs commited on
Commit
8bded5b
·
verified ·
1 Parent(s): 99a041d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +51 -0
Dockerfile ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM openjdk:17-jdk-slim AS builder
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y \
6
+ git \
7
+ curl \
8
+ gradle \
9
+ maven
10
+
11
+ RUN git clone https://github.com/Stirling-Tools/Stirling-PDF.git .
12
+
13
+ RUN ./gradlew build
14
+
15
+ FROM openjdk:17-jdk-slim
16
+
17
+ WORKDIR /app
18
+
19
+ COPY --from=builder /app/build/libs/*.jar /app/stirling-pdf.jar
20
+
21
+ RUN mkdir -p /app/logs /app/configs /app/customFiles /usr/share/tessdata && \
22
+ chmod -R 777 /app/logs /app/configs /app/customFiles /usr/share/tessdata
23
+
24
+ RUN apt-get update && apt-get install -y \
25
+ libreoffice \
26
+ poppler-utils \
27
+ tesseract-ocr \
28
+ tesseract-ocr-eng \
29
+ wget \
30
+ python3 \
31
+ python3-pip && \
32
+ pip3 install --no-cache-dir unoconv WeasyPrint pdf2image pillow && \
33
+ cd /usr/share/tessdata && \
34
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/chi_sim.traineddata && \
35
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/chi_tra.traineddata && \
36
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata && \
37
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/jpn.traineddata && \
38
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/kor.traineddata && \
39
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/rus.traineddata && \
40
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/fra.traineddata && \
41
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/deu.traineddata && \
42
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/spa.traineddata && \
43
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/ita.traineddata && \
44
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/por.traineddata && \
45
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/vie.traineddata && \
46
+ wget https://github.com/tesseract-ocr/tessdata/raw/main/tha.traineddata && \
47
+ rm -rf /var/lib/apt/lists/*
48
+
49
+ EXPOSE 7860
50
+
51
+ CMD ["java", "-Dserver.port=7860", "-Dserver.address=0.0.0.0", "-Dfile.encoding=UTF-8", "-jar", "/app/stirling-pdf.jar"]