Files
mtusi2026lab4/scripts/stop-one.sh
T
2026-11-06 14:56:03 +03:00

13 lines
435 B
Bash

#!/bin/sh
set -eu
# Stop exactly one API replica identified by TARGET_INSTANCE_ID (api-1 or api-2).
# Leaves it stopped; does not touch DB/LB/volumes.
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
cd "$(dirname "$0")/.."
case "$TARGET_INSTANCE_ID" in
api-1|api-2) ;;
*) echo "unknown TARGET_INSTANCE_ID: $TARGET_INSTANCE_ID" >&2; exit 2 ;;
esac
docker compose --env-file .env stop "$TARGET_INSTANCE_ID"
exit 0