We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b408bfe commit 6966c02Copy full SHA for 6966c02
Dockerfile
@@ -0,0 +1,16 @@
1
+# Build argument for Java version
2
+ARG JAVA_VERSION=21
3
+
4
+# Stage 1: Build the application
5
+FROM maven:3.9.4 AS builder
6
+WORKDIR /app
7
+COPY pom.xml .
8
+COPY src ./src
9
+RUN mvn clean package
10
11
+# Stage 2: Run the application
12
+FROM openjdk:${JAVA_VERSION}-jdk-slim
13
14
+COPY --from=builder /app/target/product-service.jar app.jar
15
+EXPOSE 8080
16
+ENTRYPOINT ["java", "-jar", "app.jar"]
0 commit comments