forked from mtusi2026/mtusi2026lab5
16 lines
695 B
Bash
16 lines
695 B
Bash
#!/bin/sh
|
|
set -eu
|
|
# Restart API replicas, worker and ALL state stores; preserve volumes.
|
|
cd "$(dirname "$0")/.."
|
|
REPLICAS="${API_REPLICAS:-2}"
|
|
docker compose --env-file .env restart postgres redis broker s3
|
|
# s3-gw shares the s3 network namespace and must be restarted after it.
|
|
docker compose --env-file .env restart s3-gw
|
|
# "up -d" alone leaves running replicas untouched; restart them, then restore the scale
|
|
# (migrate/s3-init already applied; skip one-shots).
|
|
docker compose --env-file .env restart api worker
|
|
docker compose --env-file .env up -d --no-deps --scale "api=${REPLICAS}" api
|
|
docker compose --env-file .env up -d --no-deps worker
|
|
docker compose --env-file .env restart lb
|
|
exit 0
|