$ErrorActionPreference = "Stop"

$CONTAINER = "hotel-mysql"

$exists = docker ps -a --format '{{.Names}}' | Where-Object { $_ -eq $CONTAINER }

if (-not $exists) {
    Write-Host "Container '$CONTAINER' does not exist."
    exit 0
}

docker stop $CONTAINER
Write-Host "Container '$CONTAINER' stopped. Data volume preserved."
