Реализовать лабораторную 3 на оценку 5 (трек 1)

This commit is contained in:
Чиняева
2026-11-07 00:57:10 +03:00
parent 0ab3a341aa
commit 2c4f0a5a61
96 changed files with 7784 additions and 45 deletions
+19
View File
@@ -0,0 +1,19 @@
@echo off
rem Stop exactly ONE API replica identified by TARGET_INSTANCE_ID.
rem The container hostname is the X-Instance-Id value used by the API.
setlocal enabledelayedexpansion
cd /d "%~dp0.."
if "%TARGET_INSTANCE_ID%"=="" (
echo TARGET_INSTANCE_ID is required 1>&2
exit /b 2
)
for /f %%i in ('docker compose --env-file .env ps -q api') do (
for /f %%h in ('docker inspect --format "{{.Config.Hostname}}" %%i') do (
if "%%h"=="%TARGET_INSTANCE_ID%" (
docker stop --time 1 %%i >nul
exit /b 0
)
)
)
echo target API replica not found: %TARGET_INSTANCE_ID% 1>&2
exit /b 1