mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
Create Dockerfile
Signed-off-by: ssrikkanth <ssrikkanth.edu@gmail.com>
This commit is contained in:
parent
c5af32d5a1
commit
4c5d0a5711
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 Spring Boot app using Maven
|
||||||
|
FROM maven:3.9.4-eclipse-temurin-17 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN mvn clean package -DskipTests
|
||||||
|
|
||||||
|
# Stage 2: Run the app using a lightweight base image
|
||||||
|
FROM eclipse-temurin:17-jdk-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/target/*.jar app.jar
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|
Loading…
Reference in a new issue