From 9f1ef361d65b14828e8db57c3a29693f597f9aa5 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 24 Oct 2024 11:22:39 -0700 Subject: [PATCH] chore: moving away from native for now --- backend/Dockerfile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index a04f7ebb..9d8b3c1a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,22 +1,34 @@ ### Builder -FROM ghcr.io/graalvm/native-image:22.3.3 AS build +FROM eclipse-temurin:17.0.8.1_1-jdk-jammy AS build + +# Install Maven +RUN apt update -y && \ + apt install -y wget tar && \ + wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz && \ + tar xzf apache-maven-3.8.6-bin.tar.gz -C /opt && \ + ln -s /opt/apache-maven-3.8.6 /opt/maven && \ + ln -s /opt/maven/bin/mvn /usr/bin/mvn && \ + rm apache-maven-3.8.6-bin.tar.gz && \ + apt-get clean + +# Add Maven to the PATH environment variable +ENV MAVEN_HOME=/opt/maven +ENV PATH=$MAVEN_HOME/bin:$PATH # Copy WORKDIR /app -COPY pom.xml mvnw ./ +COPY pom.xml ./ COPY src ./src -COPY .mvn/ ./.mvn -COPY InstallCert.java . # Build -RUN ./mvnw package -Pnative -DskipTests -Dskip.unit.tests=true -Dspring-boot.run.profiles=prod +RUN mvn clean package -DskipTests -Dskip.unit.tests=true -Dspring-boot.run.profiles=prod ### Deployer FROM eclipse-temurin:17.0.12_7-jdk-jammy AS deploy # Copy WORKDIR /app -COPY --from=build /app/target/*.jar /app/*.class ./artifacts/ +COPY --from=build /app/target/nr-results-backend.jar ./artifacts/nr-results-backend.jar COPY dockerfile-entrypoint.sh ./ RUN mkdir config dump public && \ chmod -R g+w . && \