blob: e5df56d1c225f7a10f0cdb71044f2fcae6d8534f [file] [log] [blame]
Akron042dc982023-01-25 17:18:13 +01001# Use alpine linux as base image
Akron63cd58b2024-09-04 09:46:41 +02002FROM eclipse-temurin:22-jdk-alpine as builder
Akron042dc982023-01-25 17:18:13 +01003
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
Akron63cd58b2024-09-04 09:46:41 +020032FROM eclipse-temurin:22-jre-alpine
Akron042dc982023-01-25 17:18:13 +010033
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} .