Реализовано хранилище вложений для лабораторной 4

This commit is contained in:
2026-11-02 23:40:07 +03:00
parent ec540a1a72
commit b99ad646e8
77 changed files with 2300 additions and 52 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$ROOT"
# compose down удаляет контейнеры и сеть, но оставляет именованные volumes.
docker compose --env-file .env down
docker compose --env-file .env up -d
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?test provides X-Instance-Id of the target replica}"
for container in $(docker compose ps -q api); do
instance_id=$(docker inspect --format '{{.Config.Hostname}}' "$container")
if [ "$instance_id" = "$TARGET_INSTANCE_ID" ]; then
# Manual stop leaves this replica out of service until the operator restores it.
docker stop --timeout 1 "$container" >/dev/null
exit 0
fi
done
printf '%s\n' 'target API replica was not found; no container was stopped' >&2
exit 1