add healthcheck for imaginary

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2024-12-03 11:40:29 +01:00
parent f333f740e3
commit b51223fd69
3 changed files with 14 additions and 2 deletions

View file

@ -1,7 +1,7 @@
# syntax=docker/dockerfile:latest # syntax=docker/dockerfile:latest
FROM golang:1.23.3-alpine3.20 AS go FROM golang:1.23.3-alpine3.20 AS go
ENV IMAGINARY_HASH=8f36a26c448be8c151a3878404b75fcd1cd3cf0c ENV IMAGINARY_HASH=8f36a26c448be8c151a3878404b75fcd1cd3cf0c
RUN set -ex; \ RUN set -ex; \
apk add --no-cache \ apk add --no-cache \
@ -30,6 +30,7 @@ RUN set -ex; \
COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary
COPY --chmod=775 start.sh /start.sh COPY --chmod=775 start.sh /start.sh
COPY --chmod=775 healthcheck.sh /healthcheck.sh
ENV PORT=9000 ENV PORT=9000
@ -39,5 +40,5 @@ USER 65534
ENV MALLOC_ARENA_MAX=2 ENV MALLOC_ARENA_MAX=2
ENTRYPOINT ["/start.sh"] ENTRYPOINT ["/start.sh"]
HEALTHCHECK CMD nc -z 127.0.0.1 "$PORT" || exit 1 HEALTHCHECK CMD /healthcheck.sh
LABEL com.centurylinklabs.watchtower.enable="false" LABEL com.centurylinklabs.watchtower.enable="false"

View file

@ -0,0 +1,3 @@
#!/bin/bash
nc -z 127.0.0.1 "$PORT" || exit 1

View file

@ -696,6 +696,14 @@
"image": "nextcloud/aio-imaginary", "image": "nextcloud/aio-imaginary",
"user": "65534", "user": "65534",
"init": true, "init": true,
"healthcheck": {
"start_period": "0s",
"test": "/healthcheck.sh",
"interval": "30s",
"timeout": "30s",
"start_interval": "5s",
"retries": 3
},
"expose": [ "expose": [
"9000" "9000"
], ],