-
Notifications
You must be signed in to change notification settings - Fork 14
/
alpine.Dockerfile
60 lines (45 loc) · 2.35 KB
/
alpine.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
FROM maven:3-jdk-8-alpine AS BUILD
RUN apk add --no-cache git
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN mvn --batch-mode --errors --fail-fast \
--define maven.javadoc.skip=true \
--define skipTests=true install
FROM jetty:jre8-alpine
ENV JAVAPS_ROOT ${JETTY_BASE}/webapps/ROOT
ENV JAVAPS_TMP ${JAVAPS_ROOT}/WEB-INF/tmp
ENV JAVAPS_CONFIG ${JAVAPS_ROOT}/WEB-INF/config
ENV JAVAPS_LIB ${JAVAPS_ROOT}/WEB-INF/lib
COPY --from=BUILD /usr/src/app/webapp/target/javaPS-webapp/ /var/lib/jetty/webapps/ROOT
COPY etc/docker-log4j2.xml /var/lib/jetty/webapps/ROOT/WEB-INF/config/log4j2.xml
COPY etc/docker-configuration.json /var/lib/jetty/webapps/ROOT/WEB-INF/config/configuration.json
USER root
RUN set -ex \
&& apk add --no-cache jq \
&& wget -q -P /usr/local/bin https://raw.githubusercontent.com/52North/arctic-sea/master/etc/faroe-entrypoint.sh \
&& chmod +x /usr/local/bin/faroe-entrypoint.sh \
&& ln -sf ${JAVAPS_CONFIG}/log4j2.xml ${JAVAPS_ROOT}/WEB-INF/classes/log4j2.xml \
&& mkdir -p ${JAVAPS_TMP}\
&& chown -R jetty:jetty ${JAVAPS_ROOT}
USER jetty
VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/tmp
VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/config
# use the info endpoint, the capabilities produces a lot of log spam
HEALTHCHECK --interval=30s --timeout=20s --retries=3 \
CMD wget 'http://localhost:8080/info' -q -O - > /dev/null 2>&1
ENV FAROE_CONFIGURATION ${JAVAPS_CONFIG}/configuration.json
LABEL maintainer="Benjamin Proß <[email protected]>" \
org.opencontainers.image.title="52°North javaPS" \
org.opencontainers.image.description="Next generation standardized web-based geo-processing" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.url="https://github.com/52North/javaPS" \
org.opencontainers.image.vendor="52°North GmbH" \
org.opencontainers.image.source="https://github.com/52north/javaPS.git" \
org.opencontainers.image.documentation="https://github.com/52North/javaPS/blob/develop/README.md" \
org.opencontainers.image.authors="Benjamin Proß <[email protected]>, Christian Autermann <[email protected]>"
ARG GIT_COMMIT
LABEL org.opencontainers.image.revision "${GIT_COMMIT}"
ARG BUILD_DATE
LABEL org.opencontainers.image.created "${BUILD_DATE}"
CMD [ "java", "-jar", "/usr/local/jetty/start.jar" ]
ENTRYPOINT [ "/usr/local/bin/faroe-entrypoint.sh", "/docker-entrypoint.sh" ]