mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2025-12-05 18:46:44 -05:00
17 lines
464 B
Docker
17 lines
464 B
Docker
# Stage 1: Build the application
|
|
FROM openjdk:17-jdk-slim as build
|
|
WORKDIR /app
|
|
COPY gradlew .
|
|
COPY settings.gradle .
|
|
COPY build.gradle .
|
|
COPY src ./src
|
|
# Adjust the build command for Maven: ./mvnw package -DskipTests
|
|
RUN ./gradlew bootJar
|
|
|
|
# Stage 2: Create the final lightweight image
|
|
FROM openjdk:17-jre-slim
|
|
WORKDIR /app
|
|
# Get the built JAR from the build stage
|
|
COPY --from=build /app/build/libs/*.jar app.jar
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["java", "-jar", "app.jar"] |