Балансировка, реплики, идемпотентность

This commit is contained in:
Queenfish
2026-10-16 01:07:34 +03:00
parent 0ab3a341aa
commit cb11011869
59 changed files with 3916 additions and 27 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
TARGET="${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID not set}"
for container in $(docker ps --filter "name=mtusi2026lab3-api-" --format "{{.Names}}"); do
if docker logs "$container" 2>&1 | grep -q "INSTANCE_ID=$TARGET"; then
echo "[stop-one] stopping $container (instance=$TARGET)"
docker stop "$container"
exit 0
fi
done
echo "[stop-one] no container found for INSTANCE_ID=$TARGET" >&2
exit 1