Files
story/scripts/dev.ps1
T

29 lines
1.0 KiB
PowerShell
Raw Normal View History

2026-08-26 06:41:07 +08:00
$ErrorActionPreference = 'Stop'
$projectRoot = Split-Path -Parent $PSScriptRoot
Set-Location -LiteralPath $projectRoot
docker compose config --quiet
docker compose up --build -d
2026-08-29 21:56:51 +08:00
Write-Host 'Waiting for API readiness...'
2026-08-26 06:41:07 +08:00
for ($attempt = 1; $attempt -le 60; $attempt++) {
try {
$response = Invoke-RestMethod -Uri 'http://localhost:58080/health/ready' -TimeoutSec 2
if ($response.data.status -eq 'ready') {
2026-08-29 21:56:51 +08:00
Write-Host 'Local environment is ready:'
2026-08-26 06:41:07 +08:00
Write-Host ' Web http://localhost:3100'
Write-Host ' API http://localhost:58080'
Write-Host ' Callbacks http://localhost:58081'
Write-Host ' Worker http://localhost:58082'
Write-Host ' MinIO http://localhost:59001'
Write-Host ' Keycloak http://localhost:58180'
exit 0
}
} catch {
Start-Sleep -Seconds 2
}
}
docker compose ps
2026-08-29 21:56:51 +08:00
throw 'API did not become ready in time. Run docker compose logs api postgres redis migrate for details.'