create skeleton for lab 4

This commit is contained in:
2026-11-04 21:27:54 +03:00
parent ec540a1a72
commit 8503c1b6cd
133 changed files with 10856 additions and 40 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/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
}
compose stop cleanup
compose restart postgres redis minio
wait_healthy postgres redis minio
compose restart api
wait_healthy api
compose restart nginx
wait_healthy nginx
compose start cleanup