diff --git a/Dockerfile b/Dockerfile index 635cbbff..70847ad5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,15 @@ RUN mvn compile RUN mvn dependency:copy-dependencies -DincludeScope=compile FROM eclipse-temurin:25-jre-alpine -EXPOSE 8080 +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"] +ENTRYPOINT ["java", "-classpath", "/app:/app/dependencies/*", "org.example.App"] \ No newline at end of file