-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.ps1
More file actions
22 lines (18 loc) · 666 Bytes
/
Copy pathrun.ps1
File metadata and controls
22 lines (18 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$port = 8501
$maxPort = 8510
Write-Host "--- Finance App Docker Runner ---" -ForegroundColor Cyan
while ($port -le $maxPort) {
$connection = Get-NetTCPConnection -LocalPort $port -ErrorAction SilentlyContinue
if ($null -eq $connection) {
break
}
Write-Host "Port $port is already in use, trying next one..." -ForegroundColor Yellow
$port++
}
if ($port -gt $maxPort) {
Write-Host "Error: No free ports found between 8501 and $maxPort. Please stop some containers." -ForegroundColor Red
exit 1
}
Write-Host "Starting application on http://localhost:$port" -ForegroundColor Green
$env:HOST_PORT = $port
docker compose up --build