-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
executable file
·26 lines (17 loc) · 839 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.8.1-amazoncorretto-11 as maven
WORKDIR /usr/src
COPY . /usr/src
RUN mvn clean install -DskipTests --settings=./a2d2-settings.xml
RUN for file in /usr/src/services/*; do mvn clean install -f "$file" --settings=a2d2-settings.xml -Dmaven.repo.local=client_repo; done
FROM amazoncorretto:11.0.11-alpine as final
WORKDIR /app
ENV HEALTHCHECKURL http://localhost:8080/actuator/health
ARG JAVA_OPTS
COPY --from=maven /usr/src/a2d2-api/target/a2d2-api.war /app/a2d2-api.war
COPY --from=maven /usr/src/client_repo /root/.m2/repository
COPY --from=maven /usr/src/services /app/services
RUN apk --no-cache add curl
HEALTHCHECK --interval=60s --timeout=30s --start-period=30s --retries=3 CMD curl -f $HEALTHCHECKURL 2>&1 | grep UP || exit 1
EXPOSE 8080
EXPOSE 8443
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar a2d2-api.war"]