Files
mtusi2026lab4/scripts/restart.sh
T

21 lines
675 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
set -eu
# Перезапускает API, LB, reconciler и все хранилища (PostgreSQL, Redis, S3) с сохранением volumes.
# Никаких down -v / FLUSH / повторного seed.
cd "$(dirname "$0")/.."
docker compose stop lb api reconciler
docker compose restart postgres redis s3
until docker compose exec -T postgres pg_isready -U messenger -d messenger >/dev/null 2>&1; do
sleep 1
done
until docker compose exec -T redis redis-cli ping >/dev/null 2>&1; do
sleep 1
done
until [ "$(docker inspect -f '{{.State.Health.Status}}' "$(docker compose ps -q s3)")" = healthy ]; do
sleep 1
done
docker compose start api lb reconciler