mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:55:49 +00:00
Dockerfile2 added with multi-stage
This commit is contained in:
parent
ac9bfb883a
commit
378bb21c37
1 changed files with 18 additions and 0 deletions
18
Dockerfile2
Normal file
18
Dockerfile2
Normal file
|
@ -0,0 +1,18 @@
|
|||
FROM maven:3.8.4-openjdk-17 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pom.xml .
|
||||
|
||||
COPY src/ /app/src/
|
||||
RUN mvn package
|
||||
|
||||
FROM openjdk AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/target/spring-petclinic*.jar /app/spring-petclinic.jar
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["java", "-jar", "spring-petclinic.jar"]
|
Loading…
Reference in a new issue