@echo off setlocal rem Restart API replicas and ALL state stores (PostgreSQL, Redis, SeaweedFS S3); volumes are preserved. cd /d "%~dp0\.." if "%API_REPLICAS%"=="" set API_REPLICAS=2 docker compose --env-file .env restart postgres redis s3 if errorlevel 1 exit /b 1 rem s3-gw shares the s3 network namespace and must be restarted after it. docker compose --env-file .env restart s3-gw if errorlevel 1 exit /b 1 rem "up -d" alone leaves running replicas untouched; restart them, then restore the scale. docker compose --env-file .env restart api if errorlevel 1 exit /b 1 docker compose --env-file .env up -d --no-deps --scale api=%API_REPLICAS% api if errorlevel 1 exit /b 1 docker compose --env-file .env restart lb if errorlevel 1 exit /b 1 exit /b 0