forked from duselmann/WQP-WQX-Services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (18 loc) · 858 Bytes
/
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
FROM maven:3.6.0-jdk-11 AS build
LABEL maintainer="[email protected]"
# Add pom.xml and install dependencies
COPY pom.xml /build/pom.xml
WORKDIR /build
RUN mvn -B dependency:go-offline
# Add source code and (by default) build the jar
COPY src /build/src
RUN mvn -B clean package -Dmaven.test.skip=true
FROM usgswma/openjdk:debian-stretch-openjdk-11.0.2-89c4dd2d55ba476c77aa8fd5274dcb8a1ef115b7
RUN apt-get update && apt-get install --no-install-recommends --no-upgrade -y \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY --chown=1000:1000 --from=build /build/target/wqp.jar app.jar
USER $USER
CMD ["java", "-jar", "app.jar"]
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -H "Accept: application/json" -v -k "http://127.0.0.1:${SERVER_PORT}${SERVER_CONTEXT_PATH}/actuator/health" | grep -q "{\"status\":\"UP\"}" || exit 1