This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
api_url=${API_HEALTH_URL:-http://localhost:3000/health}
|
||||
web_url=${WEB_BASE_URL:-http://localhost:8080}
|
||||
search_url=${PUBLIC_SEARCH_URL:-$web_url/api/v1/public/search?query=}
|
||||
|
||||
@@ -15,6 +14,14 @@ check_url() {
|
||||
printf '%s\n' "${label} check passed"
|
||||
}
|
||||
|
||||
check_url "$api_url" 'API'
|
||||
if [ -n "${API_HEALTH_URL:-}" ]; then
|
||||
check_url "$API_HEALTH_URL" 'API'
|
||||
else
|
||||
if ! docker compose -f compose.production.yaml exec -T api node -e "fetch('http://127.0.0.1:3000/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))"; then
|
||||
printf '%s\n' 'API health check failed inside the Compose API service.' >&2
|
||||
exit 1
|
||||
fi
|
||||
printf '%s\n' 'API check passed'
|
||||
fi
|
||||
check_url "$web_url/health" 'Web'
|
||||
check_url "$search_url" 'Public search'
|
||||
|
||||
Reference in New Issue
Block a user