#!/bin/bash

# 低代码智能体平台启动脚本

echo "🚀 启动低代码智能体平台..."
echo ""

# 检查Docker是否运行
if ! docker info > /dev/null 2>&1; then
    echo "❌ Docker 未运行，请先启动 Docker"
    exit 1
fi

# 检查docker-compose是否可用
if ! command -v docker-compose &> /dev/null; then
    echo "❌ docker-compose 未安装，请先安装 docker-compose"
    exit 1
fi

echo "📦 启动 Docker Compose 服务..."
docker-compose -f docker-compose.dev.yml up -d

echo ""
echo "⏳ 等待服务启动..."
sleep 5

echo ""
echo "✅ 服务启动完成！"
echo ""
echo "📍 访问地址："
echo "   - 前端: http://localhost:8038"
echo "   - 后端API: http://localhost:8037"
echo "   - API文档: http://localhost:8037/docs"
echo "   - 健康检查: http://localhost:8037/health"
echo ""
echo "📋 查看日志: docker-compose -f docker-compose.dev.yml logs -f"
echo "🛑 停止服务: docker-compose -f docker-compose.dev.yml down"
echo ""
