Skip to content

Instantly share code, notes, and snippets.

@initcron
Created November 3, 2022 13:13
Show Gist options
  • Save initcron/9a6e1d3edf7354bf0b49ef03f313fd09 to your computer and use it in GitHub Desktop.
Save initcron/9a6e1d3edf7354bf0b49ef03f313fd09 to your computer and use it in GitHub Desktop.
Multistage Dockerfile for Petclinic
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