Skip to content

Commit 6bc5f64

Browse files
committed
feat: add health check support
1 parent 826c9b8 commit 6bc5f64

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

15/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ RUN mkdir -p /etc/cont-init.d \
4646
/run/s6/services
4747

4848
# Make scripts executable
49-
RUN chmod +x /init /etc/cont-init.d/* 2>/dev/null || true
49+
RUN chmod +x /init /healthz /etc/cont-init.d/* 2>/dev/null || true
5050

5151
ENTRYPOINT ["/init"]

15/root/healthz

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
# Generic health check - uses HEALTHCHECK_URL env var
3+
# Override by placing custom /healthz in image's root/
4+
5+
URL="${HEALTHCHECK_URL:-}"
6+
TIMEOUT="${HEALTHCHECK_TIMEOUT:-5}"
7+
8+
if [ -z "$URL" ]; then
9+
echo "HEALTHCHECK_URL not set" >&2
10+
exit 1
11+
fi
12+
13+
exec fetch -qo /dev/null -T "$TIMEOUT" "$URL"

0 commit comments

Comments
 (0)