Реализовать лабораторную 3 на основе lab2: балансировка и идемпотентность

This commit is contained in:
Владислав Гавриленко
2026-11-13 01:30:14 +03:00
parent 0ab3a341aa
commit 4322edcbec
21 changed files with 870 additions and 31 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?Set TARGET_INSTANCE_ID from the API response}"
for id in $(docker compose ps -q api); do
hostname=$(docker inspect --format '{{.Config.Hostname}}' "$id")
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
docker stop --time 5 "$id"
exit 0
fi
done
echo 'Target is not a running API replica in this Compose project' >&2
exit 1