Dockerfile-petclinic-base 738 B

12345678910111213141516171819
  1. FROM adoptopenjdk:11-jdk as app-build
  2. # This is the base image that will contain a built version of the spring-petclinic-rest
  3. # application. Installing the dependencies and maven compiling the application is time
  4. # consuming, so we do it in a base image to save time nightly.
  5. RUN apt update && apt install -y git
  6. WORKDIR /app
  7. RUN git clone http://github.com/spring-petclinic/spring-petclinic-rest.git
  8. WORKDIR /app/spring-petclinic-rest
  9. RUN ./mvnw package -Dmaven.test.skip=true
  10. RUN cp target/spring-petclinic-rest*.jar /app/spring-petclinic-rest.jar
  11. FROM adoptopenjdk:11-jre
  12. COPY --from=app-build /app/spring-petclinic-rest.jar /app/spring-petclinic-rest.jar
  13. WORKDIR /app
  14. EXPOSE 9966
  15. CMD ["java", "-jar", "spring-petclinic-rest.jar"]