добавлены чаты, сообщения и проверка сохранности

This commit is contained in:
2026-10-08 00:24:34 +03:00
parent 7f8bcfd234
commit 4922e68dca
3 changed files with 599 additions and 5 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
echo "Stopping application and stores..."
docker compose down
echo "Starting application and stores..."
docker compose up -d
echo "Waiting for services to become healthy..."
for attempt in $(seq 1 60); do
postgres_status=$(
docker compose ps postgres --format json \
| python -c 'import sys, json; data=json.load(sys.stdin); print(data.get("Health", ""))'
)
redis_status=$(
docker compose ps redis --format json \
| python -c 'import sys, json; data=json.load(sys.stdin); print(data.get("Health", ""))'
)
api_status=$(
docker compose ps api --format json \
| python -c 'import sys, json; data=json.load(sys.stdin); print(data.get("Health", ""))'
)
if [[ "$postgres_status" == "healthy" \
&& "$redis_status" == "healthy" \
&& "$api_status" == "healthy" ]]; then
echo "All services are healthy."
exit 0
fi
sleep 1
done
echo "Services did not become healthy in time." >&2
docker compose ps
exit 1