feat: API replicas over HAProxy (3)

This commit is contained in:
2026-11-06 03:26:54 +03:00
parent de2f63b926
commit ec111aadfb
32 changed files with 396 additions and 147 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
ENGINE=${ENGINE:-podman}
PROJECT=${PROJECT:-messenger-lab3}
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
for id in $($ENGINE ps -q --filter "label=com.docker.compose.project=$PROJECT" --filter "label=com.docker.compose.service=api"); do
if [ "$($ENGINE inspect -f '{{.Config.Hostname}}' "$id")" = "$TARGET_INSTANCE_ID" ]; then
$ENGINE stop -t 5 "$id" >/dev/null
exit 0
fi
done
exit 1