# ==============================================================================
#  lf_mri_platform -- Stop all Docker services
#  Usage:
#    .\stop.ps1           -- stop containers (keep volumes)
#    .\stop.ps1 -Clean    -- stop + remove volumes (full reset)
# ==============================================================================
param([switch]$Clean)

$ErrorActionPreference = "Stop"

Write-Host "`n==> Stopping LF-MRI services" -ForegroundColor Cyan

$envFile = Join-Path $PSScriptRoot ".env"

if ($Clean) {
    Write-Host "    Removing containers AND volumes (full reset)" -ForegroundColor Yellow
    & docker compose --env-file $envFile down --volumes
} else {
    & docker compose --env-file $envFile down
}

Write-Host "    [OK] Services stopped" -ForegroundColor Green
