#!/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 "ai-tax-agent-frontend"; then
    docker network create ai-tax-agent-frontend
    echo "✅ Created frontend network: ai-tax-agent-frontend"
else
    echo "ℹ️  Frontend network already exists: ai-tax-agent-frontend"
fi

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

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