Skip to content

Commit 313ee35

Browse files
authored
Create Dockerfile
1 parent 7d58281 commit 313ee35

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Step 1: Use Maven with JDK 17 to build the app
2+
FROM maven:3.9.9-eclipse-temurin-17 AS builder
3+
WORKDIR /app
4+
COPY pom.xml .
5+
COPY src ./src
6+
RUN mvn clean package -DskipTests
7+
# Step 2: Use lightweight JRE 17 for running the app
8+
FROM eclipse-temurin:17.0.15_6-jre
9+
WORKDIR /app
10+
COPY --from=builder /app/target/back-end-0.0.1-SNAPSHOT.jar app.jar
11+
EXPOSE 8080
12+
ENTRYPOINT ["java", "-jar", "app.jar"]

0 commit comments

Comments
 (0)