diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d693668c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# Stage 1: Build the Spring Boot app using Maven +FROM maven:3.9.4-eclipse-temurin-17 AS build +WORKDIR /app +COPY . . +RUN mvn clean package -DskipTests + +# Stage 2: Run the app using a lightweight base image +FROM eclipse-temurin:17-jdk-alpine +WORKDIR /app +COPY --from=build /app/target/*.jar app.jar + +EXPOSE 8080 +ENTRYPOINT ["java", "-jar", "app.jar"]