Healthcheck

This commit is contained in:
Kroese 2023-04-21 08:30:00 +02:00 committed by GitHub
parent ae2d269409
commit ff40c3d5ae

View File

@ -1,13 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
# Docker Healthcheck
PORT=5000 PORT=5000
IP="20.20.20.21" IP="20.20.20.21"
FILE="/var/dsm.ip"
[ -f "$FILE" ] && IP=$(cat "${FILE}")
if ! curl -m 3 -ILfSs "http://$IP:$PORT/"; then if ! curl -m 3 -ILfSs "http://$IP:$PORT/"; then
echo "Failed to reach $IP" echo "Failed to reach $IP"
exit 1 exit 1
fi fi
echo "Healthcheck OK" echo "Healthcheck OK for $IP"
exit 0 exit 0