Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

feat: add HEALTHCHECK to all Dockerfiles (#328)

Matej Šnuderl8149c21c9cff
diff --git a/Dockerfile b/Dockerfile
index afdca72a35..2082e259e3 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 e3eee37a1b..04ed8ac290 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 0c84c7323b..e6d52820d7 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 10e608125d..6f542cc7b3 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"]