42 lines
980 B
Bash
42 lines
980 B
Bash
|
|
#!/bin/bash
|
||
|
|
set -e
|
||
|
|
|
||
|
|
echo "🚀 Deploying Silserv"
|
||
|
|
|
||
|
|
# Check prerequisites
|
||
|
|
if ! command -v docker &> /dev/null; then
|
||
|
|
echo "❌ Docker is not installed"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
if ! command -v docker-compose &> /dev/null; then
|
||
|
|
echo "❌ Docker Compose is not installed"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Create necessary directories
|
||
|
|
mkdir -p data logs
|
||
|
|
|
||
|
|
# Create network if it doesn't exist
|
||
|
|
docker network create silserv-network 2>/dev/null || echo "Network already exists"
|
||
|
|
|
||
|
|
# Build and start services
|
||
|
|
docker-compose down || true
|
||
|
|
docker-compose up --build -d
|
||
|
|
|
||
|
|
# Wait for services to be ready
|
||
|
|
echo "⏳ Waiting for services to start..."
|
||
|
|
sleep 10
|
||
|
|
|
||
|
|
# Check health
|
||
|
|
if curl -f -s http://localhost:36530/health > /dev/null; then
|
||
|
|
echo "✅ Silserv is healthy"
|
||
|
|
else
|
||
|
|
echo "❌ Silserv health check failed"
|
||
|
|
docker compose logs silserv
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
echo "🎉 Deployment completed successfully!"
|
||
|
|
echo "📊 Dashboard: http://localhost:36530"
|
||
|
|
echo "🔍 API Status: http://localhost:36530/api/status"
|