feat:report

This commit is contained in:
Оля Мороз
2026-10-23 18:10:07 +03:00
parent ae53d39ccc
commit f4500589c6
134 changed files with 5282 additions and 237 deletions
+19 -7
View File
@@ -1,14 +1,26 @@
#!/bin/sh
set -eu
# Перезапуск API + всех state stores, volumes сохраняются.
docker compose restart postgres redis api1 api2 lb
# Ждём готовности.
for i in $(seq 1 60); do
if docker compose exec -T lb wget -qO- http://127.0.0.1:8080/health/ready >/dev/null 2>&1; then
echo "ready after ${i}s"
# ./scripts/restart.sh # 2 реплики (по умолчанию)
# ./scripts/restart.sh 4 # 4 реплики
REPLICAS="${1:-2}"
# Останов с сохранением volumes.
docker compose down --remove-orphans
# Пересоздание сети + контейнеров с нужным числом реплик.
API_REPLICAS="$REPLICAS" \
docker compose --env-file .env -f compose.yaml up -d --build
# Ждём готовности с хоста.
i=0
while [ "$i" -lt 90 ]; do
if curl -sf http://localhost:8080/health/ready >/dev/null 2>&1; then
echo "ready after ${i}s (replicas=$REPLICAS)"
exit 0
fi
i=$((i + 1))
sleep 1
done
echo "stack did not become ready in 60s" >&2
echo "stack did not become ready in 90s" >&2
exit 1