argos/backend/Dockerfile

39 lines
1.3 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
2020-04-27 15:21:03 +02:00
2024-02-22 08:30:30 +01:00
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-08 12:31:46 +02:00
ARG CITE_MAVEN_REPO_URL
2020-04-27 15:21:03 +02:00
COPY pom.xml /build/
2024-04-05 12:32:07 +02:00
COPY core /build/core/
2020-04-27 15:21:03 +02:00
COPY web /build/web/
2024-04-05 12:32:07 +02:00
COPY settings.xml /root/.m2/settings.xml
RUN rm -f /build/web/src/main/resources/config/*-devel.yml
2024-04-08 09:59:10 +02:00
RUN rm -f /build/web/src/main/resources/logging/*.xml
2020-04-27 15:21:03 +02:00
WORKDIR /build/
2024-02-22 08:30:30 +01:00
#RUN mvn package -q
2024-04-08 12:31:46 +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
2024-02-22 08:30:30 +01:00
# Build project
2024-04-08 12:31:46 +02:00
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} package
2024-02-22 08:30:30 +01:00
######################################## Run Stage ########################################
FROM eclipse-temurin:21-jre-alpine
2020-04-27 15:21:03 +02:00
WORKDIR /app
2024-02-22 08:30:30 +01:00
ARG PROFILE
2024-02-22 10:52:47 +01:00
ARG REVISION
2024-04-05 12:32:07 +02:00
ENV SERVER_PORT=8080
EXPOSE ${SERVER_PORT}
2024-02-22 08:30:30 +01:00
2024-04-08 09:29:05 +02:00
COPY --from=build-stage /build/web/target/web-${REVISION}.jar /app/app.jar
2024-02-22 08:30:30 +01:00
2024-04-08 09:09:19 +02:00
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${PROFILE}", "-Dspring.config.additional-location=file:/config/", "-jar", "/app/app.jar"]