#!/bin/bash
# Create external Docker networks for AI Tax Agent

set -e

echo "Creating external Docker networks..."

# Create frontend network (for Traefik and public-facing services)
if ! docker network ls | grep -q "apa-frontend"; then
    docker network create apa-frontend
    echo "✅ Created frontend network: apa-frontend"
else
    echo "ℹ️  Frontend network already exists: apa-frontend"
fi

# Create backend network (for internal services)
if ! docker network ls | grep -q "apa-backend"; then
    docker network create apa-backend
    echo "✅ Created backend network: apa-backend"
else
    echo "ℹ️  Backend network already exists: apa-backend"
fi

echo "🎉 Network setup complete!"
echo ""
echo "Networks created:"
docker network ls | grep "apa-"
