From 2ede5fbf1fa26b330d2107b6026ed347b49f02d6 Mon Sep 17 00:00:00 2001 From: aj-nife <79135943+aj-nife@users.noreply.github.com> Date: Fri, 16 Jun 2023 18:53:11 +0530 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2af883..61842d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ # Use an official OpenJDK runtime as a parent image -FROM openjdk:8-jre-alpine +FROM maven:3-jdk-8-alpine # set shell to bash # source: https://stackoverflow.com/a/40944512/3128926 RUN apk update && apk add bash -# Set the working directory to /app -WORKDIR /app +WORKDIR /sources -# Copy the fat jar into the container at /app -COPY /target/docker-java-app-example.jar /app +COPY * /sources + +RUN cd /sources && mvn clean package dependency:copy-dependencies # Make port 8080 available to the world outside this container EXPOSE 8080 # Run jar file when the container launches -CMD ["java", "-jar", "docker-java-app-example.jar"] \ No newline at end of file +CMD ["java", "-jar", "target/docker-java-app-example.jar"] From 10e25c58c549b5ad860dd120f7299d07477d7b4d Mon Sep 17 00:00:00 2001 From: aj-nife <79135943+aj-nife@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:14:30 +0530 Subject: [PATCH 2/2] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 61842d4..5b9d9a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /sources COPY * /sources -RUN cd /sources && mvn clean package dependency:copy-dependencies +RUN cd /sources && mvn clean package # Make port 8080 available to the world outside this container EXPOSE 8080