30 lines
928 B
PowerShell
30 lines
928 B
PowerShell
# PowerShell script to start all services with Dapr
|
|
# Usage: .\start-all.ps1
|
|
|
|
Write-Host "Starting LingAdmin Microservices..." -ForegroundColor Green
|
|
|
|
# Check if Docker is running (for Redis)
|
|
$dockerRunning = docker ps 2>&1
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Docker is not running. Please start Docker Desktop." -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# Check if Redis is running, if not start it
|
|
$redisRunning = docker ps --filter "name=redis" --format "{{.Names}}"
|
|
if (-not $redisRunning) {
|
|
Write-Host "Starting Redis container..." -ForegroundColor Yellow
|
|
docker run -d --name redis -p 6379:6379 redis:latest
|
|
Start-Sleep -Seconds 2
|
|
} else {
|
|
Write-Host "Redis is already running." -ForegroundColor Green
|
|
}
|
|
|
|
# Change to the dapr directory
|
|
Set-Location $PSScriptRoot\dapr
|
|
|
|
# Start all services using Dapr Multi-App Run
|
|
Write-Host "Starting services with Dapr..." -ForegroundColor Yellow
|
|
dapr run -f dapr.yaml
|
|
|