argos/dmp-backend/Dockerfile.CI

34 lines
1.2 KiB
Docker
Raw Normal View History

2024-02-22 08:30:30 +01:00
####################################### Build stage #######################################
FROM maven:3.9-eclipse-temurin-21-alpine AS build-stage
ARG MAVEN_ACCOUNT_USR
ARG MAVEN_ACCOUNT_PSW
ARG REVISION
ARG PROFILE
ARG DEV_PROFILE_URL
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
2020-09-24 16:20:33 +02:00
COPY pom.xml /build/
2024-02-22 09:01:08 +01:00
COPY core /build/core
#COPY elastic /build/elastic/
2020-09-24 16:20:33 +02:00
COPY web /build/web/
2024-02-22 09:01:08 +01:00
COPY settings.xml /root/.m2/settings.xml
2024-02-22 08:30:30 +01:00
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
2020-09-24 16:20:33 +02:00
WORKDIR /build/
2024-02-22 08:30:30 +01:00
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} dependency:go-offline
# Build project
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean package
######################################## Run Stage ########################################
FROM eclipse-temurin:21-jre-alpine
2020-09-24 16:20:33 +02:00
WORKDIR /app
2023-10-12 09:57:38 +02:00
2024-02-22 08:30:30 +01:00
ARG PROFILE
ARG REVISION
2024-02-22 10:52:47 +01:00
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app/app.jar
2024-02-22 08:30:30 +01:00
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${PROFILE}", "-Dspring.config.additional-location=/files/config/", "-cp", "/app/app.jar", "-Dloader.path=/files/repo-jars", "org.springframework.boot.loader.PropertiesLauncher"]