Добавил брокер и worker в compose-стенд

This commit is contained in:
gera
2026-11-06 01:59:07 +03:00
parent dfa8784afa
commit 60f0f2bf13
7 changed files with 425 additions and 14 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
ROOT="$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
dc="docker compose --env-file .env"
old=$($dc ps -q api)
n=$(echo "$old" | wc -w)
$dc build migrate
$dc up -d --no-deps migrate janitor worker
$dc up -d --no-deps --no-recreate --scale api=$((n * 2)) api
$dc up -d --wait --no-deps --no-recreate --scale api=$((n * 2)) api
for c in $old; do
docker stop -t 10 "$c" >/dev/null
docker rm "$c" >/dev/null
done
$dc up -d --wait --no-deps --no-recreate --scale api=$n api