This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
92 lines (69 loc) · 2.75 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
################################
#
# Java builder -- JDK
#
FROM openjdk:11-jdk-slim AS java-builder
# tesseract-ocr < 4.0 is only available from the previous Debian Stretch distribution
# for installing it plese uncomment the following lines with '###''
### RUN echo "deb http://ftp.de.debian.org/debian stretch main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y tesseract-ocr tesseract-ocr-eng tesseract-ocr-osd && \
apt-get update && \
apt-get install -y imagemagick --fix-missing && \
# apt-get install -y tesseract-ocr=4.00~git2439-c3ed6f03-1~bpo9+1 tesseract-ocr-eng=4.00~git28-f7a4c12-1~bpo9+1 tesseract-ocr-osd=4.00~git28-f7a4c12-1~bpo9+1 && \
### apt-get install -y tesseract-ocr-osd=3.04.00-1 tesseract-ocr-eng=3.04.00-1 tesseract-ocr=3.04.01-5 && \
# apt-get install -y imagemagick=8:6.9.7.4+dfsg-11+deb9u6 --fix-missing && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
################################
#
# Java runner -- JRE
#
FROM openjdk:11-jre-slim AS java-runner
# tesseract-ocr < 4.0 is only available from the previous Debian Stretch distribution
# for installing it please uncomment the following lines with '###''
### RUN echo "deb http://ftp.de.debian.org/debian stretch main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y tesseract-ocr tesseract-ocr-eng tesseract-ocr-osd && \
apt-get update && \
apt-get install -y imagemagick --fix-missing && \
# apt-get install -y tesseract-ocr=4.00~git2439-c3ed6f03-1~bpo9+1 tesseract-ocr-eng=4.00~git28-f7a4c12-1~bpo9+1 tesseract-ocr-osd=4.00~git28-f7a4c12-1~bpo9+1 && \
### apt-get install -y tesseract-ocr-osd=3.04.00-1 tesseract-ocr-eng=3.04.00-1 tesseract-ocr=3.04.01-5 && \
# apt-get install -y imagemagick=8:6.9.7.4+dfsg-11+deb9u6 --fix-missing && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
################################
#
# CogStack builder
#
FROM java-builder AS cogstack-builder
# setup the build environment
RUN mkdir -p /devel
WORKDIR /devel
COPY ./gradle/wrapper /devel/gradle/wrapper
COPY ./gradlew /devel/
RUN ./gradlew --version
COPY ./build.gradle ./settings.gradle /devel/
COPY . /devel/
# build cogstack
RUN ./gradlew bootJar --no-daemon
################################
#
# CogStack runner
#
FROM java-runner
# setup env
#RUN apt-get update && apt-get install -y procps
RUN mkdir -p /cogstack
WORKDIR /cogstack
# copy artifacts
COPY --from=cogstack-builder /devel/build/libs/cogstack-*.jar ./
COPY --from=cogstack-builder /devel/scripts/*.sh ./
# copy external tools configuration files
COPY ./extras/ImageMagick/policy.xml /etc/ImageMagick-6/policy.xml
# entry point
CMD /bin/bash