This commit is contained in:
k00kzaAntonovaIra
2026-11-16 14:16:01 +03:00
parent 276dbdad8a
commit 8bedaa7592
177 changed files with 17065 additions and 430 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
compose() {
docker compose --env-file .env "$@"
}
wait_healthy() {
for service in "$@"; do
attempts=0
until states=$(compose ps --format '{{.Health}}' "$service") \
&& [ -n "$states" ] \
&& [ -z "$(printf '%s\n' "$states" | grep -v '^healthy$')" ]; do
attempts=$((attempts + 1))
if [ "$attempts" -ge 60 ]; then
echo "$service не стал healthy за 60 секунд" >&2
exit 1
fi
sleep 1
done
done
}
worker_running=$(compose ps --status running --quiet worker)
compose stop worker publisher cleanup
compose restart postgres redis minio broker
wait_healthy postgres redis minio broker
compose restart api
wait_healthy api
compose restart nginx
wait_healthy nginx
compose start publisher cleanup
if [ -n "$worker_running" ]; then
compose start worker
fi