File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM maven:3.6.3-jdk-11 as MAVEN_BUILD
2+
3+ MAINTAINER Armand Ballaci
4+
5+ COPY pom.xml .
6+
7+ COPY src src
8+
9+ RUN mvn dependency:go-offline -B
10+
11+ RUN mvn clean package -DskipTests
12+
13+ RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
14+
15+ # Production Stage for Spring boot application image
16+ # Also, there is a clean separation between dependencies and application resources in a Spring Boot fat jar file,
17+ # and we can use that fact to improve performance. The key is to create layers in the container filesystem.
18+ # The layers are cached both at build time and at runtime (in most runtimes) so we want the most frequently changing resources,
19+ # usually the class and static resources in the application itself, to be layered after the more slowly changing resources.
20+ # Thus we will use a slightly different implementation of the Dockerfile: https://spring.io/guides/gs/spring-boot-docker/
21+ FROM openjdk:11-jdk-slim as production
22+ ARG DEPENDENCY=target/dependency
23+ COPY --from=MAVEN_BUILD ${DEPENDENCY}/BOOT-INF/lib /app/lib
24+ COPY --from=MAVEN_BUILD ${DEPENDENCY}/META-INF /app/META-INF
25+ COPY --from=MAVEN_BUILD ${DEPENDENCY}/BOOT-INF/classes /app
26+ EXPOSE 8080
27+ ENTRYPOINT ["java" ,"-cp" ,"app:app/lib/*" ,"de.ballaci.jpa.SakilaApplication" ]
You can’t perform that action at this time.
0 commit comments