Skip to content

Commit d108fec

Browse files
authored
Add Dockerfile for backend build and run stages
1 parent 88f16ce commit d108fec

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

backend/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ---------- BUILD STAGE ----------
2+
FROM maven:3.9.6-eclipse-temurin-21 AS build
3+
WORKDIR /app
4+
COPY pom.xml .
5+
RUN mvn -B -q -e -DskipTests dependency:go-offline
6+
COPY src ./src
7+
RUN mvn clean package -DskipTests
8+
9+
# ---------- RUN STAGE ----------
10+
FROM eclipse-temurin:21-jre
11+
WORKDIR /app
12+
COPY --from=build /app/target/*.jar backend.jar
13+
EXPOSE 8081
14+
ENTRYPOINT ["java","-jar","backend.jar"]

0 commit comments

Comments
 (0)