diff --git a/Dockerfile b/Dockerfile index afdca72a3..2082e259e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,9 @@ VOLUME /app/data EXPOSE 4566 6379-6399 +HEALTHCHECK --interval=5s --timeout=3s --retries=5 \ + CMD wget -q --spider http://localhost:4566/_floci/health || exit 1 + ARG VERSION=latest ENV FLOCI_VERSION=${VERSION} diff --git a/Dockerfile.jvm-package b/Dockerfile.jvm-package index e3eee37a1..04ed8ac29 100644 --- a/Dockerfile.jvm-package +++ b/Dockerfile.jvm-package @@ -21,6 +21,9 @@ COPY --chown=1001:root target/quarkus-app quarkus-app/ EXPOSE 4566 6379-6399 +HEALTHCHECK --interval=5s --timeout=3s --retries=5 \ + CMD wget -q --spider http://localhost:4566/_floci/health || exit 1 + USER 1001 -ENTRYPOINT ["java", "-jar", "quarkus-app/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file +ENTRYPOINT ["java", "-jar", "quarkus-app/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0"] diff --git a/Dockerfile.native b/Dockerfile.native index 0c84c7323..e6d52820d 100644 --- a/Dockerfile.native +++ b/Dockerfile.native @@ -25,6 +25,9 @@ VOLUME /app/data EXPOSE 4566 +HEALTHCHECK --interval=5s --timeout=3s --retries=5 \ + CMD bash -c 'echo -e "GET /_floci/health HTTP/1.0\r\nHost: localhost\r\n\r\n" > /dev/tcp/localhost/4566' || exit 1 + ARG VERSION=latest ENV FLOCI_VERSION=${VERSION} diff --git a/Dockerfile.native-package b/Dockerfile.native-package index 10e608125..6f542cc7b 100644 --- a/Dockerfile.native-package +++ b/Dockerfile.native-package @@ -18,6 +18,9 @@ COPY --chown=1001:root target/*-runner /app/application EXPOSE 4566 +HEALTHCHECK --interval=5s --timeout=3s --retries=5 \ + CMD curl -f http://localhost:4566/_floci/health || exit 1 + USER 1001 -CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]