diff --git a/Dockerfile b/Dockerfile index f2af883..5b9d9a2 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 # 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"]