Files
sino-mci/scripts/local-up.sh
marsal 91d5c29f23 feat(admin-web): add Vue 3 admin console and deployment configs
- Add admin-web/ with Vite + Vue 3 + Element Plus + Vue Router
- Add 8 management pages: dashboard, channel subject/account, conversation,
  person, tag, send record (with test send), inbound flow
- Add API client modules for account/channel/crm/send/flow
- Add Dockerfile and nginx config for admin-web
- Add Dockerfile for mci-server
- Add docker-compose.app.yml for one-command app deployment
- Add K8s deployment manifests for backend/admin-web/channel-service
- Update scripts/local-up.sh with shared network and --with-apps option
2026-07-07 12:42:17 +08:00

60 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR/.."
echo "Creating shared network..."
docker network create mci-network 2>/dev/null || true
echo "Starting local infrastructure..."
docker compose -f infrastructure/docker-compose.yml up -d
echo "Waiting for MySQL..."
MAX_RETRIES=60
RETRY_COUNT=0
until docker exec mci-mysql mysql -uroot -proot -e "SELECT 1" > /dev/null 2>&1; do
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then
echo "MySQL did not become ready within ${MAX_RETRIES} seconds."
exit 1
fi
sleep 1
done
echo "Waiting for Redis..."
RETRY_COUNT=0
until docker exec mci-redis redis-cli ping | grep -q "PONG"; do
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ "$RETRY_COUNT" -ge 30 ]; then
echo "Redis did not become ready within 30 seconds."
exit 1
fi
sleep 1
done
echo "Waiting for RabbitMQ..."
RETRY_COUNT=0
until curl -s -o /dev/null -w "%{http_code}" http://guest:guest@localhost:15672/api/overview | grep -q "200"; do
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ "$RETRY_COUNT" -ge 30 ]; then
echo "RabbitMQ did not become ready within 30 seconds."
exit 1
fi
sleep 1
done
echo "Local infrastructure is ready."
echo "MySQL: jdbc:mysql://localhost:3306/sino_mci"
echo "Redis: localhost:6379"
echo "RabbitMQ: localhost:5672 / http://localhost:15672"
echo "SeaweedFS: http://localhost:9333"
if [ "$1" == "--with-apps" ]; then
echo "Starting application services..."
docker compose -f docker-compose.app.yml up -d --build
echo "Admin Web: http://localhost"
echo "Backend API: http://localhost:8080/msg-platform"
echo "Channel Service: http://localhost:8000"
fi