Skip to content

Commit ff066f8

Browse files
committed
2 parents 984b27f + a57695f commit ff066f8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
# Step 1: Use Maven with JDK 17 to build the app
22
FROM maven:3.9.9-eclipse-temurin-17 AS builder
3+
4+
# WORKDIR /app section
35
WORKDIR /app
6+
7+
# pom.xml section
48
COPY pom.xml .
9+
10+
# src ./src section
511
COPY src ./src
12+
13+
# RUN section
614
RUN mvn clean package -DskipTests
15+
716
# Step 2: Use lightweight JRE 17 for running the app
817
FROM eclipse-temurin:17.0.15_6-jre
18+
19+
# WORKDIR /app section
920
WORKDIR /app
21+
22+
# from=builder section
1023
COPY --from=builder /app/target/back-end-0.0.1-SNAPSHOT.jar app.jar
24+
25+
# Port section
1126
EXPOSE 8080
27+
28+
# ENTRYPOINT section
1229
ENTRYPOINT ["java", "-jar", "app.jar"]

0 commit comments

Comments
 (0)