S3-вложения и сверка Postgresql с MinIO

This commit is contained in:
2026-11-13 19:15:04 +03:00
parent ec540a1a72
commit 79e94f9d2a
60 changed files with 6702 additions and 50 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# Останавливает одну API-реплику и оставляет её остановленной.
# TARGET_INSTANCE_ID — значение X-Instance-Id (hostname контейнера).
set -eu
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
target=$(printf '%s' "$TARGET_INSTANCE_ID" | tr -d '[:space:]')
found=""
for id in $(docker compose --env-file .env ps -q api); do
host=$(docker inspect -f '{{.Config.Hostname}}' "$id")
full=$(docker inspect -f '{{.Id}}' "$id")
short=$(printf '%s' "$full" | cut -c1-12)
if [ "$host" = "$target" ] || [ "$short" = "$target" ] || [ "$full" = "$target" ]; then
found=$id
break
fi
done
if [ -z "$found" ]; then
echo "API replica not found" >&2
exit 1
fi
docker stop -t 8 "$found" >/dev/null