From f3c1ade38dd76ab29150a437f86cb6fb24180837 Mon Sep 17 00:00:00 2001 From: nhkhai Date: Tue, 30 Apr 2024 19:02:59 +0800 Subject: [PATCH] Update Dockerfile Changed to the alternative build flow for the docker file. --- Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d11eea8..a799e2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,19 +9,21 @@ ENV PORT=9090 # The JAR file path. # ARG JAR_FILE=*.jar -ARG JAR_FILE=the-review-room-0.0.1-SNAPSHOT.jar +# ARG JAR_FILE=the-review-room-0.0.1-SNAPSHOT.jar # Copy the JAR file from the build context into the Docker image. -COPY target/${JAR_FILE} application.jar -#COPY .mvn/ .mvn -#COPY mvnw pom.xml ./ +# COPY target/${JAR_FILE} application.jar -#COPY src ./src +# Copy the source code into the Docker image. +COPY .mvn/ .mvn +COPY mvnw pom.xml ./ + +COPY src ./src #CMD apt-get update -y # Set the default command to run the Java application. #ENTRYPOINT ["java", "-Xmx2048M", "-jar", "/application.jar"] -ENTRYPOINT ["java","-jar","/application.jar"] -#RUN ./mvnw install -DskipTests -#CMD ["./mvnw", "spring-boot:run"] +# ENTRYPOINT ["java","-jar","/application.jar"] +RUN ./mvnw install -DskipTests +CMD ["./mvnw", "spring-boot:run"]