-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-prod.ps1
More file actions
18 lines (15 loc) · 903 Bytes
/
docker-compose-prod.ps1
File metadata and controls
18 lines (15 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# --- MODIFICATION START ---
$clusterName = "cluster-a"
# Generate random suffixes for dynamic pod names
$userSuffix = -join ((97..122) | Get-Random -Count 5 | ForEach-Object { [char]$_ })
$adminSuffix = -join ((97..122) | Get-Random -Count 5 | ForEach-Object { [char]$_ })
# Set the environment variables, now prefixed with the cluster name
$env:USER_SERVICE_POD_NAME = "$clusterName-broadcast-user-service-$userSuffix"
$env:ADMIN_SERVICE_POD_NAME = "$clusterName-broadcast-admin-service-$adminSuffix"
$env:CLUSTER_NAME = $clusterName
# --- MODIFICATION END ---
Write-Host "Starting services with dynamic pod names:" -ForegroundColor Cyan
Write-Host " User Service Pod Name: $env:USER_SERVICE_POD_NAME"
Write-Host " Admin Service Pod Name: $env:ADMIN_SERVICE_POD_NAME"
# Run docker-compose, which will now pick up the environment variables
docker-compose --profile prod up --build --force-recreate