Implement lab4 S3 attachments and reliability checks

This commit is contained in:
Polusikkkk
2026-11-05 18:42:22 +03:00
parent ec540a1a72
commit 0f6615dbb9
51 changed files with 6018 additions and 23 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
compose() {
docker compose \
-f compose.yaml \
-f compose.s3.yaml \
--env-file .env \
"$@"
}
echo "Stopping LB and API..."
compose stop --timeout 5 lb api
echo "Restarting PostgreSQL, Redis and S3..."
compose restart --timeout 10 postgres redis s3
echo "Waiting for PostgreSQL..."
attempt=0
until compose exec -T postgres \
pg_isready -U messenger -d messenger >/dev/null 2>&1
do
attempt=$((attempt + 1))
if [ "$attempt" -ge 20 ]; then
echo "PostgreSQL did not become ready" >&2
exit 1
fi
sleep 1
done
echo "Starting API and LB..."
compose start api lb
echo "Restart hook completed."