Created
November 3, 2022 13:13
-
-
Save initcron/9a6e1d3edf7354bf0b49ef03f313fd09 to your computer and use it in GitHub Desktop.
Multistage Dockerfile for Petclinic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM schoolofdevops/maven:spring AS BUILD | |
WORKDIR /app | |
COPY . . | |
RUN mvn spring-javaformat:apply && \ | |
mvn package -DskipTests | |
FROM openjdk:8u212-jre-alpine3.9 AS PKG | |
WORKDIR /run | |
COPY --from=BUILD /app/target/spring-petclinic-2.3.1.BUILD-SNAPSHOT.jar /run/petclinic.jar | |
EXPOSE 8080 | |
CMD java -jar petclinic.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment