|
|
@@ -5,11 +5,13 @@ FROM maven:3.8.5-openjdk-17-slim AS build
|
|
|
# Set the working directory in the container
|
|
|
WORKDIR /app
|
|
|
# Copy the pom.xml and the project files to the container
|
|
|
-COPY pom.xml .
|
|
|
-COPY src ./src
|
|
|
-COPY settings.xml /usr/share/maven/ref/
|
|
|
+ADD ./pom.xml pom.xml
|
|
|
+ADD settings.xml /usr/share/maven/ref/
|
|
|
+RUN mvn install -Dmaven.repo.local=./.m2
|
|
|
+
|
|
|
+ADD ./src src/
|
|
|
# Build the application using Maven
|
|
|
-RUN mvn clean package -DskipTests
|
|
|
+RUN mvn clean package -DskipTests -Dmaven.repo.local=./.m2
|
|
|
|
|
|
# Use an official OpenJDK image as the base image
|
|
|
FROM openjdk:17-jdk-slim
|