2024-01-26 10:07:11 +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
|
|
|
|
ENV server_username=$MAVEN_ACCOUNT_USR
|
|
|
|
ENV server_password=$MAVEN_ACCOUNT_PSW
|
2024-04-23 15:11:32 +02:00
|
|
|
ARG CITE_MAVEN_REPO_URL
|
2024-01-26 10:07:11 +01:00
|
|
|
|
|
|
|
COPY pom.xml /build/
|
|
|
|
COPY core /build/core/
|
|
|
|
COPY web /build/web/
|
|
|
|
COPY settings.xml /root/.m2/settings.xml
|
|
|
|
RUN rm -f /build/web/src/main/resources/config/app.env
|
|
|
|
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
|
|
|
|
# RUN rm -f /build/web/src/main/resources/logging/*.xml
|
|
|
|
|
|
|
|
WORKDIR /build/
|
|
|
|
|
2024-04-23 15:11:32 +02:00
|
|
|
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} clean
|
|
|
|
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} install
|
|
|
|
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} package
|
2024-01-26 10:07:11 +01:00
|
|
|
|
|
|
|
######################################## Run Stage ########################################
|
2024-03-13 15:46:21 +01:00
|
|
|
FROM eclipse-temurin:21
|
2024-01-26 10:07:11 +01:00
|
|
|
|
|
|
|
ARG PROFILE
|
|
|
|
ARG REVISION
|
|
|
|
ENV SERVER_PORT=8080
|
|
|
|
EXPOSE ${SERVER_PORT}
|
|
|
|
|
2024-02-22 13:25:46 +01:00
|
|
|
COPY --from=build-stage /build/web/target/file-transformer-rda-web-${REVISION}.jar /app/file-transformer-rda-web.jar
|
2024-01-26 10:07:11 +01:00
|
|
|
|
|
|
|
ENTRYPOINT ["java","-Dspring.config.additional-location=file:/config/","-Dspring.profiles.active=${PROFILE}","-Djava.security.egd=file:/dev/./urandom","-jar","/app/file-transformer-rda-web.jar"]
|