blob: b3ed71fb7620a285b3f9386e1061e344cde917be [file] [log] [blame]
Akron042dc982023-01-25 17:18:13 +01001# Use alpine linux as base image
2FROM openjdk:19-alpine as builder
3
4# Copy repository respecting .dockerignore
5COPY . /export
6
7WORKDIR /export
8
9RUN apk update && \
10 apk add --no-cache git \
11 maven
12
13RUN git config --global user.email "korap+docker@ids-mannheim.de" && \
14 git config --global user.name "Docker"
15
16# Install Kalamar-Plugin-Export
17RUN mkdir built && \
18 git clone https://github.com/KorAP/Kalamar-Plugin-Export.git Kalamar-Plugin-Export && \
19 cd Kalamar-Plugin-Export && \
20 git checkout master && \
21 mvn clean package
22
23# Package
24RUN cd Kalamar-Plugin-Export && \
25 find target/KalamarExportPlugin-*.jar -exec mv {} ../built/KalamarExportPlugin.jar ';'
26
27RUN apk del git \
28 maven
29
30RUN cd ${M2_HOME} && rm -r .m2
31
32FROM openjdk:19-alpine
33
34RUN addgroup -S korap && \
35 adduser -S export -G korap && \
36 mkdir export && \
37 chown -R export.korap /export
38
39WORKDIR /export
40
41COPY --from=builder /export/built/KalamarExportPlugin.jar /export/
42
43USER export
44
45EXPOSE 7777
46
47ENTRYPOINT [ "java", "-jar" ]
48
49CMD [ "KalamarExportPlugin.jar" ]
50
51
52# docker build -f Dockerfile -t korap/kalamar-plugin-export:{nr} .