From b51223fd69178ddd42577fa16748fd51d5599152 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Tue, 3 Dec 2024 11:40:29 +0100 Subject: [PATCH] add healthcheck for imaginary Signed-off-by: Simon L. --- Containers/imaginary/Dockerfile | 5 +++-- Containers/imaginary/healthcheck.sh | 3 +++ php/containers.json | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Containers/imaginary/healthcheck.sh diff --git a/Containers/imaginary/Dockerfile b/Containers/imaginary/Dockerfile index 20c90fa5e87..efe0ed70f47 100644 --- a/Containers/imaginary/Dockerfile +++ b/Containers/imaginary/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:latest FROM golang:1.23.3-alpine3.20 AS go -ENV IMAGINARY_HASH=8f36a26c448be8c151a3878404b75fcd1cd3cf0c +ENV IMAGINARY_HASH=8f36a26c448be8c151a3878404b75fcd1cd3cf0c RUN set -ex; \ apk add --no-cache \ @@ -30,6 +30,7 @@ RUN set -ex; \ COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary COPY --chmod=775 start.sh /start.sh +COPY --chmod=775 healthcheck.sh /healthcheck.sh ENV PORT=9000 @@ -39,5 +40,5 @@ USER 65534 ENV MALLOC_ARENA_MAX=2 ENTRYPOINT ["/start.sh"] -HEALTHCHECK CMD nc -z 127.0.0.1 "$PORT" || exit 1 +HEALTHCHECK CMD /healthcheck.sh LABEL com.centurylinklabs.watchtower.enable="false" diff --git a/Containers/imaginary/healthcheck.sh b/Containers/imaginary/healthcheck.sh new file mode 100644 index 00000000000..46d700fcb22 --- /dev/null +++ b/Containers/imaginary/healthcheck.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +nc -z 127.0.0.1 "$PORT" || exit 1 diff --git a/php/containers.json b/php/containers.json index d99a18817ad..265010eda57 100644 --- a/php/containers.json +++ b/php/containers.json @@ -696,6 +696,14 @@ "image": "nextcloud/aio-imaginary", "user": "65534", "init": true, + "healthcheck": { + "start_period": "0s", + "test": "/healthcheck.sh", + "interval": "30s", + "timeout": "30s", + "start_interval": "5s", + "retries": 3 + }, "expose": [ "9000" ],