Skip to content

Commit 83482dd

Browse files
committed
chore: production error i try to build jar before
1 parent e4ce478 commit 83482dd

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

backend/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
FROM eclipse-temurin:17-jdk-alpine
2-
1+
# Stage 1: build JAR
2+
FROM maven:3.9.2-eclipse-temurin-17 AS build
33
WORKDIR /app
4+
COPY pom.xml .
5+
COPY src ./src
6+
RUN mvn clean package -DskipTests
47

5-
6-
# Copy the prebuilt JAR from Maven
7-
COPY target/*.jar habitflow-image.jar
8-
8+
# Stage 2: runtime
9+
FROM eclipse-temurin:17-jdk-alpine
10+
WORKDIR /app
11+
COPY --from=build /app/target/*.jar habitflow-image.jar
912
EXPOSE 8080
10-
1113
ENTRYPOINT ["java", "-jar", "habitflow-image.jar"]
12-

0 commit comments

Comments
 (0)