mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-12-27 19:07:28 +00:00
Add Dockerfile
Signed-off-by: vamsiknadella <nadellavamsik@gmail.com>
This commit is contained in:
parent
3e1ce239f4
commit
559c899e61
1 changed files with 13 additions and 0 deletions
13
Dockerfile
Normal file
13
Dockerfile
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Stage 1: Build the JAR file
|
||||
FROM maven:3.8.5-openjdk-17 AS build
|
||||
WORKDIR /app
|
||||
COPY pom.xml .
|
||||
COPY src ./src
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Stage 2: Run the JAR file
|
||||
FROM openjdk:17-jdk-slim
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/target/*.jar app.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue