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 08:34:49 +01:00
|
|
|
#COPY elastic /build/elastic/
|
2020-09-24 16:20:33 +02:00
|
|
|
COPY web /build/web/
|
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 08:32:38 +01:00
|
|
|
COPY --from=build-stage /build/web/target/web-1.0-SNAPSHOT.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"]
|