veza/scripts/archive/start-veza-docker.sh

86 lines
2.3 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
echo "🐳 Démarrage de l'application Veza en mode Docker..."
# Vérifier que Docker est installé
if ! command -v docker &> /dev/null; then
echo "❌ Docker n'est pas installé"
exit 1
fi
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose n'est pas installé"
exit 1
fi
# Arrêter les conteneurs existants
echo "🛑 Arrêt des conteneurs existants..."
docker-compose -f docker-compose.production.yml down 2>/dev/null
# Démarrer tous les services
echo "🚀 Démarrage des services..."
docker-compose -f docker-compose.production.yml up -d
# Attendre que les services soient prêts
echo "⏳ Attente que les services soient prêts..."
sleep 30
# Vérifier l'état des services
echo ""
echo "🔍 Vérification des services..."
# Backend API
if curl -s http://localhost:8080/api/health > /dev/null; then
echo "✅ Backend API: http://localhost:8080"
else
echo "❌ Backend API: Non accessible"
fi
# Frontend
if curl -s http://localhost:5174 > /dev/null; then
echo "✅ Frontend React: http://localhost:5174"
else
echo "❌ Frontend React: Non accessible"
fi
# Stream Server
if curl -s http://localhost:8082 > /dev/null; then
echo "✅ Stream Server: http://localhost:8082"
else
echo "❌ Stream Server: Non accessible"
fi
# Grafana
if curl -s http://localhost:3000 > /dev/null; then
echo "✅ Grafana: http://localhost:3000"
else
echo "❌ Grafana: Non accessible"
fi
# PostgreSQL
if docker exec veza-postgres-prod pg_isready -U veza_user > /dev/null 2>&1; then
echo "✅ PostgreSQL: localhost:5432"
else
echo "❌ PostgreSQL: Non accessible"
fi
# Redis
if docker exec veza-redis-prod redis-cli ping > /dev/null 2>&1; then
echo "✅ Redis: localhost:6379"
else
echo "❌ Redis: Non accessible"
fi
echo ""
echo "🎉 Application Veza démarrée en mode Docker !"
echo ""
echo "📱 Services accessibles :"
echo " • Frontend Web: http://localhost:5174"
echo " • Backend API: http://localhost:8080"
echo " • Stream Server: http://localhost:8082"
echo " • Grafana (Monitoring): http://localhost:3000"
echo " • PostgreSQL: localhost:5432"
echo " • Redis: localhost:6379"
echo ""
echo "💡 Pour arrêter: docker-compose -f docker-compose.production.yml down"
echo "💡 Pour voir les logs: docker-compose -f docker-compose.production.yml logs -f"