Complete lab 7 security implementation

This commit is contained in:
2026-11-26 22:26:21 +03:00
parent 20afc2c790
commit df47ebd9f1
89 changed files with 9765 additions and 53 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID environment variable is required}"
echo "Looking for API container with instance_id=$TARGET_INSTANCE_ID"
found=""
for container in $(docker ps --format '{{.Names}}' | grep -E '^mtusi.*-api-[0-9]+$'); do
if docker logs "$container" 2>&1 | grep -q "instance_id=$TARGET_INSTANCE_ID"; then
found="$container"
break
fi
done
if [ -z "$found" ]; then
echo "ERROR: no container found with instance_id=$TARGET_INSTANCE_ID" >&2
exit 1
fi
echo "Stopping container: $found"
docker stop "$found"
echo "Container $found stopped. Other replicas continue serving."
exit 0