This commit is contained in:
2026-11-05 18:08:31 +03:00
parent ec540a1a72
commit d6e976e4c0
33 changed files with 2789 additions and 52 deletions
+21
View File
@@ -0,0 +1,21 @@
@echo off
setlocal
cd /d "%~dp0.."
if "%TARGET_INSTANCE_ID%"=="" (
echo TARGET_INSTANCE_ID is required 1>&2
exit /b 2
)
set TARGET_STOPPED=
for /f "delims=" %%i in ('docker compose ps -q api') do if not defined TARGET_STOPPED call :stop_if_target %%i
if defined TARGET_STOPPED exit /b 0
echo No running API replica matches TARGET_INSTANCE_ID 1>&2
exit /b 1
:stop_if_target
for /f "delims=" %%h in ('docker inspect --format "{{.Config.Hostname}}" %1') do if "%%h"=="%TARGET_INSTANCE_ID%" (
docker stop --time 2 %1 >nul
if errorlevel 1 exit /b 1
set TARGET_STOPPED=1
exit /b 0
)
exit /b 1