Files
mtusi2026lab2/scripts/restart.sh
T
Queenfish 6bfbcf74fc
Skeleton contracts / contracts (pull_request) Failing after 37s
Мессенджер с Postgres, Redis, Valkey
2026-10-08 13:21:48 +03:00

22 lines
537 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
echo "[restart.sh] docker compose down (volumes preserved)"
docker compose --env-file .env down
echo "[restart.sh] docker compose up -d --build"
docker compose --env-file .env up -d --build
echo "[restart.sh] waiting for /health/ready"
for i in $(seq 1 90); do
if curl -fsS http://localhost:8080/health/ready >/dev/null 2>&1; then
echo "[restart.sh] api is ready"
exit 0
fi
sleep 1
done
echo "[restart.sh] api did not become ready in 90 seconds" >&2
exit 1