From e059fad39d7b450471f905399286b3d3aa2fb3c9 Mon Sep 17 00:00:00 2001 From: Edvin Sandgren <229709012+EdvinSandgren@users.noreply.github.com> Date: Sun, 15 Mar 2026 16:33:54 +0100 Subject: [PATCH 1/2] Updates Dockerfile to add Healthcheck --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 635cbbff..cbd646d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,12 @@ RUN mvn dependency:copy-dependencies -DincludeScope=compile FROM eclipse-temurin:25-jre-alpine EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -f http://localhost:8080/ || exit 1 RUN addgroup -S appgroup && adduser -S appuser -G appgroup WORKDIR /app/ COPY --from=build /build/target/classes/ /app/ COPY --from=build /build/target/dependency/ /app/dependencies/ COPY www/ ./www/ +RUN apk --no-cache add curl USER appuser -ENTRYPOINT ["java", "-classpath", "/app:/app/dependencies/*", "org.example.App"] +ENTRYPOINT ["java", "-classpath", "/app:/app/dependencies/*", "org.example.App"] \ No newline at end of file From b2e50c101fabe40437d455386ba389fbaada6ea2 Mon Sep 17 00:00:00 2001 From: Edvin Sandgren <229709012+EdvinSandgren@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:18:08 +0100 Subject: [PATCH 2/2] Port update in Dockerfile Updates Dockerfile to implement changes proposed by CodeRabbit, possibly enabling the port to be configured in future for the container rather than being static --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbd646d6..70847ad5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,15 @@ RUN mvn compile RUN mvn dependency:copy-dependencies -DincludeScope=compile FROM eclipse-temurin:25-jre-alpine -EXPOSE 8080 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -f http://localhost:8080/ || exit 1 +ARG PORT=8080 +EXPOSE $PORT RUN addgroup -S appgroup && adduser -S appuser -G appgroup WORKDIR /app/ COPY --from=build /build/target/classes/ /app/ COPY --from=build /build/target/dependency/ /app/dependencies/ COPY www/ ./www/ +ENV HEALTHCHECK_PORT=$PORT +HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD sh -c 'curl -fsS "http://localhost:${HEALTHCHECK_PORT}/" || exit 1' RUN apk --no-cache add curl USER appuser ENTRYPOINT ["java", "-classpath", "/app:/app/dependencies/*", "org.example.App"] \ No newline at end of file