argos/notification-service/Dockerfile

35 lines
1.4 KiB
Docker
Raw Normal View History

2023-12-08 10:25:07 +01:00
####################################### Build stage #######################################
FROM maven:3.9-eclipse-temurin-17-alpine AS build-stage
2024-02-20 14:47:55 +01:00
ARG MAVEN_ACCOUNT_USR
ARG MAVEN_ACCOUNT_PSW
2024-02-20 14:35:56 +01:00
ARG REVISION
ARG PROFILE
ARG DEV_PROFILE_URL
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
2023-12-08 10:25:07 +01:00
COPY pom.xml /build/
COPY notification /build/notification/
COPY notification-web /build/notification-web/
COPY settings.xml /root/.m2/settings.xml
RUN rm -f /build/notification-web/src/main/resources/config/app.env
RUN rm -f /build/notification-web/src/main/resources/config/*-dev.yml
RUN rm -f /build/notification-web/src/main/resources/logging/*.xml
RUN rm -f /build/notification-web/src/main/resources/certificates/*.crt
WORKDIR /build/
2024-02-20 14:35:56 +01:00
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} dependency:go-offline
2023-12-08 10:25:07 +01:00
# Build project
2024-02-20 14:35:56 +01:00
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean package
2023-12-08 10:25:07 +01:00
######################################## Run Stage ########################################
FROM eclipse-temurin:17-jre-ubi9-minimal
2024-02-20 14:35:56 +01:00
ARG PROFILE
ARG REVISION
2023-12-08 10:25:07 +01:00
COPY --from=build-stage /build/notification-web/target/sti-viewer-notification-web.jar /app/sti-viewer-notification-web.jar
ENTRYPOINT ["java","-Dspring.config.additional-location=file:/config/","-Dspring.profiles.active=${PROFILE}","-Djava.security.egd=file:/dev/./urandom","-jar","/app/sti-viewer-notification-web.jar"]