Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Changed to the alternative build flow for the docker file.
  • Loading branch information
nhkhai committed Apr 30, 2024
1 parent f1bf3b9 commit f3c1ade
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit f3c1ade

Please sign in to comment.