argos/dmp-backend/Dockerfile

36 lines
1.1 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
ARG DEV_PROFILE_URL
ENV server_username=$MAVEN_ACCOUNT_USR
ENV server_password=$MAVEN_ACCOUNT_PSW
2020-04-27 15:21:03 +02:00
COPY pom.xml /build/
COPY data /build/data/
COPY elastic /build/elastic/
2022-09-13 09:35:56 +02:00
#COPY logging /build/logging/
2020-04-27 15:21:03 +02:00
COPY queryable /build/queryable/
COPY web /build/web/
2024-02-22 08:30:30 +01:00
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
2020-04-27 15:21:03 +02:00
WORKDIR /build/
2024-02-22 08:30:30 +01:00
#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
######################################## 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 08:32:38 +01:00
COPY --from=build-stage /build/web/target/web-1.0-SNAPSHOT.jar /app.jar
2024-02-22 08:30:30 +01:00
2020-05-12 12:10:23 +02:00
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]