| # Use alpine linux as base image |
| FROM openjdk:8-alpine as builder |
| # Copy repository respecting .dockerignore |
| RUN git config --global user.email "korap+docker@ids-mannheim.de" && \ |
| git config --global user.name "Docker" |
| RUN mkdir Koral && git clone https://github.com/KorAP/Koral.git Koral && \ |
| RUN git clone https://github.com/KorAP/Krill.git Krill && \ |
| find target/Kustvakt-lite-*.jar -exec mv {} ../built/Kustvakt-lite.jar ';' |
| RUN sed 's!\(krill\.indexDir\s*=\).\+!\1\/kustvakt\/index!' lite/src/main/resources/kustvakt-lite.conf \ |
| > built/kustvakt-lite.conf |
| RUN cd ${M2_HOME} && rm -r .m2 |
| RUN addgroup -S korap && \ |
| adduser -S kustvakt -G korap && \ |
| chown -R kustvakt.korap /kustvakt |
| COPY --from=builder /kustvakt/built/* /kustvakt/ |
| CMD ["java", "-jar", "Kustvakt-lite.jar"] |