feat: add health monitoring endpoint
This commit is contained in:
@@ -11,6 +11,10 @@ cd "${SITE_DIR}"
|
||||
echo "==> Pulling latest code"
|
||||
git -C "${APP_DIR}" pull origin main
|
||||
|
||||
GIT_SHA=$(git -C "${APP_DIR}" rev-parse --short HEAD)
|
||||
BUILD_ID="build-$(date +%Y%m%d)-${GIT_SHA}"
|
||||
export GIT_SHA BUILD_ID
|
||||
|
||||
echo "==> Updating compose file"
|
||||
cp "${APP_DIR}/docker-compose.prod.yml" "${SITE_DIR}/docker-compose.prod.yml"
|
||||
|
||||
@@ -22,7 +26,7 @@ docker compose -f "${SITE_DIR}/docker-compose.prod.yml" up -d --no-deps --build
|
||||
|
||||
echo "==> Waiting for health check"
|
||||
for i in $(seq 1 30); do
|
||||
if curl -fsS -H "Host: nohypeai.net" http://localhost:8001/ >/dev/null 2>&1; then
|
||||
if curl -fsS -H "Host: nohypeai.net" http://localhost:8001/health/ >/dev/null 2>&1; then
|
||||
echo "==> Site is up"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user