Skip to content

Commit

Permalink
chore: moving away from native for now
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj committed Oct 24, 2024
1 parent 452cd66 commit 9f1ef36
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . && \
Expand Down

0 comments on commit 9f1ef36

Please sign in to comment.