Complete Lab 4 attachment service

This commit is contained in:
2026-11-14 02:11:47 +03:00
parent ec540a1a72
commit 1c10525136
36 changed files with 2740 additions and 73 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env sh
set -eu
cd "$(dirname "$0")/.."
# Stop the entry points before every state store; named volumes are left intact.
docker compose stop lb api redis db s3
docker compose start db redis s3
attempt=0
until docker compose exec -T db pg_isready -U messenger -d messenger >/dev/null 2>&1 \
&& docker compose exec -T redis sh -ec 'REDISCLI_AUTH="$(cat /run/secrets/redis_password)" redis-cli ping | grep -q PONG' >/dev/null 2>&1 \
&& docker compose exec -T s3 curl -fsS http://127.0.0.1:9000/health/ready >/dev/null 2>&1; do
attempt=$((attempt + 1))
if [ "$attempt" -ge 60 ]; then
echo 'Database/cache did not become ready within 60 seconds.' >&2
exit 1
fi
sleep 1
done
docker compose --env-file .env up -d migrate s3-bootstrap
docker compose --env-file .env up -d --scale api=2 api lb