-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 807 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (18 loc) · 807 Bytes
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.3-jdk-11 AS build
LABEL maintainer="gs-w_eto_eb_federal_employees@usgs.gov"
# 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:11
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/qw_portal_services-*.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}/about/health" | grep -q "{\"status\":\"UP\"}" || exit 1