Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions health_check
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

set -e

# Web health check if web is started in this container
if [ -f /run/supervisor.conf.d/web.conf ]; then
if [ -f /app/data/ssl/privkey.pem ]; then
Expand All @@ -13,6 +11,14 @@ fi

# Supervisor based health check
services="$(/app/venv/bin/supervisorctl status)"
status_code=$?
# 3 is expected as there is a single stopped service (check)
if [ $status_code -ne 0 ] && [ $status_code -ne 3 ]; then
echo "supervisorctl failed ($status_code)"
exit 1
fi

# Look for failed services
failing="$(echo "$services" | grep -v '^check *EXITED\|RUNNING' || true)"
if [ -n "$failing" ]; then
echo "$failing"
Expand Down
Loading