#!/bin/bash

# Archipelago Docker Environment Stop Script
# This script stops all the containerized apps

set -e

echo "🛑 Stopping Archipelago Docker Environment..."

# Use docker compose (new) or docker-compose (old)
if docker compose version &> /dev/null 2>&1; then
    COMPOSE_CMD="docker compose"
else
    COMPOSE_CMD="docker-compose"
fi

$COMPOSE_CMD down

echo ""
echo "✅ All containers stopped successfully!"
echo ""
echo "💡 To remove volumes (data), run: $COMPOSE_CMD down -v"
