# ----------------------------------------------------------------------- #
FROM docker.io/library/gradle:9.2.1-jdk21 AS builder
WORKDIR /
COPY ./src/main/ ./src/main/
COPY ./build.gradle ./
COPY ./gradle.properties ./
COPY ./settings.gradle ./
COPY ./gradle/libs.versions.toml ./gradle/
RUN gradle build --no-daemon

# ----------------------------------------------------------------------- #
FROM docker.io/alpine/java:21-jre AS run

RUN apk --no-cache add curl

COPY --from=builder /build/libs/kontor-javalin-0.2.0-SNAPSHOT.jar app.jar

EXPOSE 8600

CMD ["java", "-jar", "app.jar"]

