-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·72 lines (61 loc) · 2.02 KB
/
deploy.sh
File metadata and controls
executable file
·72 lines (61 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# Domain Manager Deployment Script
# This script helps set up and deploy the Domain Manager application
set -e
echo "🚀 Domain Manager Deployment Script"
echo "=================================="
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
# Check if Docker Compose is installed
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
exit 1
fi
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
echo "📝 Creating .env file from template..."
cp env.example .env
echo "✅ .env file created. Please edit it with your configuration."
echo " You can run this script again after configuring .env"
exit 0
fi
# Function to check if .env is properly configured
check_env() {
if grep -q "your-super-secret-jwt-key" .env; then
echo "⚠️ Warning: Default JWT secret detected. Please change it in .env file."
return 1
fi
return 0
}
# Check environment configuration
if ! check_env; then
echo "❌ Please configure your .env file before continuing."
exit 1
fi
# Build and start services
echo "🔨 Building and starting services..."
docker-compose up -d --build
# Wait for services to be ready
echo "⏳ Waiting for services to be ready..."
sleep 10
# Check if services are running
echo "🔍 Checking service status..."
if docker-compose ps | grep -q "Up"; then
echo "✅ Services are running successfully!"
echo ""
echo "🌐 Application URLs:"
echo " Frontend: http://localhost"
echo " Backend API: http://localhost:5000"
echo " Health Check: http://localhost:5000/health"
echo ""
echo "📊 To view logs: docker-compose logs -f"
echo "🛑 To stop services: docker-compose down"
echo ""
echo "🎉 Domain Manager is now running!"
else
echo "❌ Some services failed to start. Check logs with: docker-compose logs"
exit 1
fi