update Dockerfiles

This commit is contained in:
Alexandros Mandilaras 2024-04-08 10:59:10 +03:00
parent 79431f0865
commit bdfcb8cdf6
2 changed files with 9 additions and 5 deletions

View File

@ -14,7 +14,7 @@ COPY core /build/core/
COPY web /build/web/
COPY settings.xml /root/.m2/settings.xml
RUN rm -f /build/web/src/main/resources/config/*-devel.yml
RUN rm -f /build/annotation-web/src/main/resources/logging/*.xml
RUN rm -f /build/web/src/main/resources/logging/*.xml
WORKDIR /build/

View File

@ -10,14 +10,15 @@ ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
COPY pom.xml /build/
COPY core /build/core
#COPY elastic /build/elastic/
COPY core /build/core/
COPY web /build/web/
COPY settings.xml /root/.m2/settings.xml
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
RUN rm -f /build/web/src/main/resources/config/*-devel.yml
RUN rm -f /build/web/src/main/resources/logging/*.xml
WORKDIR /build/
#RUN mvn package -q
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
@ -29,6 +30,9 @@ WORKDIR /app
ARG PROFILE
ARG REVISION
ENV SERVER_PORT=8080
EXPOSE ${SERVER_PORT}
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app/app.jar
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"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${PROFILE}", "-Dspring.config.additional-location=file:/config/", "-jar", "/app/app.jar"]