forked from mtusi2026/mtusi2026lab2
Мессенджер с Postgres, Redis, Valkey
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user