Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Commit

Permalink
add back Dockerfile as example
Browse files Browse the repository at this point in the history
  • Loading branch information
bonifaido committed Nov 7, 2019
1 parent ea248db commit d84f571
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM maven:3.5-jdk-11-slim as build

# Resolve all the dependencies and cache them to save a LOT of time
COPY pom.xml /usr/src/myapp/
RUN mvn -f /usr/src/myapp/pom.xml dependency:resolve dependency:resolve-plugins

# Build the application, usually only this part gets rebuilt locally, use offline mode and skip tests
COPY src /usr/src/myapp/src
RUN mvn -f /usr/src/myapp/pom.xml clean package -DskipTests -o

# The final image should have minimal layers
FROM openjdk:11-jre-slim
RUN apt-get update && apt-get install curl -y
COPY --from=build /usr/src/myapp/target/app.jar app.jar
ENTRYPOINT java -jar app.jar

0 comments on commit d84f571

Please sign in to comment.