#!/bin/bash # 聊天应用开发环境启动脚本 - Linux版本 echo "🚀 启动聊天应用 (开发模式)..." echo # 检查Docker是否安装 if ! command -v docker &> /dev/null; then echo "❌ 错误: Docker未安装" echo "请先安装Docker: https://docs.docker.com/engine/install/" exit 1 fi # 检查Docker Compose是否安装 if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then echo "❌ 错误: Docker Compose未安装" echo "请先安装Docker Compose: https://docs.docker.com/compose/install/" exit 1 fi # 检查Docker服务是否运行 if ! docker info &> /dev/null; then echo "❌ 错误: Docker服务未运行" echo "请启动Docker服务: sudo systemctl start docker" exit 1 fi echo "✅ Docker环境检查通过" echo # 构建并启动开发环境 echo "📦 构建并启动开发环境..." if command -v docker-compose &> /dev/null; then docker-compose -f docker-compose.dev.yml up --build else docker compose -f docker-compose.dev.yml up --build fi