# Stage 1: Build the Maven artifact FROM maven:3.9-eclipse-temurin-17 AS build WORKDIR /app # Optimize build by caching dependencies where possible COPY pom.xml . # Download dependencies RUN mvn dependency:go-offline -B # Copy source code and build the JAR COPY src ./src RUN mvn clean package -DskipTests # Stage 2: Setup the runtime environment FROM eclipse-temurin:17-jre WORKDIR /app # Copy the constructed fat JAR from the builder stage COPY --from=build /app/target/starter-1.0.0-SNAPSHOT-fat.jar ./app.jar COPY keystore.jceks ./ EXPOSE 8888 # Start the Vert.x application ENTRYPOINT ["java", "-jar", "app.jar"]