ЛР4 - БПИ2303 - Стругов - на 4

This commit is contained in:
wanderinho
2026-11-22 22:11:48 +03:00
parent ec540a1a72
commit 0a942ff3ba
32 changed files with 4387 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?test provides instance alias}"
# Default Docker hostname is the container's short ID, used as X-Instance-Id.
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 2 "$id" >/dev/null
exit 0
fi
done
printf '%s\n' 'No running API container matches TARGET_INSTANCE_ID' >&2
exit 1