# ------------------------------- # Stage1 : Build # ------------------------------- FROM eclipse-temurin:21-jdk-jammy AS build # Set working directory WORKDIR /app # Copy project files COPY . . # Make gradlew executable RUN chmod +x ./gradlew # Run Gradle build (backend + frontend) # Assumes you have your Gradle Node tasks wired: npmInstall -> buildFrontend -> copyFrontend RUN ./gradlew bootJar --no-daemon # ---------------------- # Stage 2: Runtime # ---------------------- FROM eclipse-temurin:21-jdk-jammy WORKDIR /app # Copy the fat JAR from build stage COPY --from=build /app/build/libs/*.jar app.jar # Expose Spring Boot default port EXPOSE 8088 # Run the spring boot app ENTRYPOINT ["java","-jar","app.jar", "--spring.profiles.active=prod"]