upgrade argos Dockerfiles

This commit is contained in:
Alexandros Mandilaras 2024-02-22 09:30:30 +02:00
parent f7babf1f0b
commit 5bb31d0a59
4 changed files with 45 additions and 14 deletions

View File

@ -1,6 +1,13 @@
FROM maven:3-jdk-11 AS MAVEN_BUILD ####################################### 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 pom.xml /build/
COPY data /build/data/ COPY data /build/data/
@ -8,16 +15,22 @@ COPY elastic /build/elastic/
#COPY logging /build/logging/ #COPY logging /build/logging/
COPY queryable /build/queryable/ COPY queryable /build/queryable/
COPY web /build/web/ COPY web /build/web/
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
WORKDIR /build/ WORKDIR /build/
RUN mvn package -q
#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
FROM amazoncorretto:11
WORKDIR /app WORKDIR /app
ARG PROFILE
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app.jar COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"] ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]

View File

@ -1,14 +1,32 @@
FROM maven:3-openjdk-11 AS MAVEN_BUILD ####################################### 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 pom.xml /build/
COPY elastic /build/elastic/ COPY elastic /build/elastic/
COPY web /build/web/ COPY web /build/web/
RUN rm -f /build/web/src/main/resources/config/*-dev.yml
WORKDIR /build/ WORKDIR /build/
RUN mvn package
FROM adoptopenjdk/openjdk11:alpine-jre 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
WORKDIR /app WORKDIR /app
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app/app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${PROF}", "-Dspring.config.additional-location=/files/config/", "-cp", "/app/app.jar", "-Dloader.path=/files/repo-jars", "org.springframework.boot.loader.PropertiesLauncher"]
ARG PROFILE
ARG REVISION
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.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"]

View File

@ -1,5 +1,5 @@
# stage1 as builder # stage1 as builder
FROM node:12-alpine AS BUILDER FROM node:20-alpine AS BUILDER
WORKDIR /app WORKDIR /app

View File

@ -1,5 +1,5 @@
# stage1 as builder # stage1 as builder
FROM node:12-alpine as builder FROM node:20-alpine AS builder
# copy the package.json to install dependencies # copy the package.json to install dependencies
COPY package.json ./ COPY package.json ./