From ffed4ae8947ffab2e65253181103d8c5f6d3eff2 Mon Sep 17 00:00:00 2001 From: amandilaras Date: Tue, 20 Feb 2024 16:27:25 +0200 Subject: [PATCH] add Dockerfile and settings.xml --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ settings.xml | 29 +++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 Dockerfile create mode 100644 settings.xml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..23d5a33 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +####################################### 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 + +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/ + +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 + +ARG PROFILE +ARG REVISION +ENV SERVER_PORT=8080 +EXPOSE ${SERVER_PORT} + +COPY --from=build-stage /build/web/target/file-transformer-docx-${REVISION}.jar /app/file-transformer-docx.jar + +ENTRYPOINT ["java","-Dspring.config.additional-location=file:/config/","-Dspring.profiles.active=${PROFILE}","-Djava.security.egd=file:/dev/./urandom","-jar","/app/file-transformer-docx.jar"] \ No newline at end of file diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000..7614d63 --- /dev/null +++ b/settings.xml @@ -0,0 +1,29 @@ + + + + ossrh + ${server_username} + ${server_password} + + + dev + ${server_username} + ${server_password} + + + + + dev + + true + + + + dev + Dev Profile + ${devProfileUrl} + + + + + \ No newline at end of file