From e25150442a0796d5b0fe1d8947f4e691f68170eb Mon Sep 17 00:00:00 2001 From: Ng Heng Khai Date: Wed, 1 May 2024 13:09:56 +0800 Subject: [PATCH] Update Dockerfile Updated to properly use ENTRYPOINT and CMD. --- Dockerfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b26d9aa..e108a97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,4 +43,18 @@ RUN chmod +x ./mvnw # Compile the Java application. RUN ./mvnw install -DskipTests -CMD ["./mvnw", "spring-boot:run"] + +# Run as a non root user. +# RUN adduser -D myuser +# USER myuser + +# Set the default command to run the Java application. +# The ENTRYPOINT instruction specifies the command that should be run. +# ENTRYPOINT ["java"] +ENTRYPOINT [ "./mvnw" ] + +# The CMD instruction provides default arguments to the ENTRYPOINT command. +# CMD ["-Xmx2048M", "-jar", "/application.jar"] # Set a Java heap size of 2GB for the run. +# CMD ["-jar","/application.jar"] +# CMD ["./mvnw", "spring-boot:run"] +CMD ["spring-boot:run"] \ No newline at end of file