-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# Build stage
#
FROM maven:3.6.3-openjdk-11 AS build
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml clean package
#
# Package stage
#
FROM gcr.io/distroless/java-debian10
# Download last language package
ADD https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata /usr/share/tessdata/eng.traineddata
ADD https://github.com/tesseract-ocr/tessdata/raw/master/ces.traineddata /usr/share/tessdata/ces.traineddata
ADD https://github.com/tesseract-ocr/tessdata/raw/master/slk.traineddata /usr/share/tessdata/slk.traineddata
# Set the name of the jar
ENV APP_FILE ocrApi-0.0.1-SNAPSHOT.jar
# Open the port, inside docker network
EXPOSE 8086
# Copy our JAR
#COPY target/$APP_FILE /app.jar
COPY --from=build /usr/src/app/target/ocrApi-0.0.1-SNAPSHOT.jar /usr/app/ocrApi-0.0.1-SNAPSHOT.jar
# Launch the Spring Boot application
#ENV JAVA_OPTS=""
#ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar " ]
#ENTRYPOINT ["java", "-jar", "/app.jar"]
ENTRYPOINT ["java", "-jar", "/usr/app/ocrApi-0.0.1-SNAPSHOT.jar"]