mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:15:50 +00:00
asda
This commit is contained in:
parent
0368d9003c
commit
e90475a95f
1 changed files with 1 additions and 25 deletions
26
Dockerfile
26
Dockerfile
|
@ -1,25 +1 @@
|
|||
# Stage 1: Build Stage
|
||||
FROM maven:3.9.4-eclipse-temurin-17 AS build
|
||||
|
||||
# Set the working directory inside the build stage
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the Maven project files to the build stage
|
||||
COPY pom.xml .
|
||||
COPY src ./src
|
||||
|
||||
# Build the project and create the jar
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Stage 2: Runtime Stage
|
||||
FROM openjdk:17-alpine
|
||||
|
||||
# Set the working directory inside the runtime stage
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the built jar from the build stage
|
||||
COPY --from=build /app/target/spring-petclinic-4.0.2-SNAPSHOT.jar /app/
|
||||
|
||||
# Command to run the application
|
||||
CMD ["java", "-jar", "spring-petclinic-4.0.2-SNAPSHOT.jar"]
|
||||
|
||||
FROM alpine:latest
|
||||
|
|
Loading…
Reference in a new issue