forked from surajyog/nanomides
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-docker.sh
More file actions
94 lines (81 loc) · 2.57 KB
/
Copy pathstart-docker.sh
File metadata and controls
94 lines (81 loc) · 2.57 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# Bot Civilization Platform - Docker Startup Script
# For Judges and Quick Demo
echo "🤖 Bot Civilization Platform - Docker Setup"
echo "============================================"
echo ""
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed!"
echo "Please install Docker Desktop from: https://www.docker.com/products/docker-desktop"
exit 1
fi
# Check if Docker Compose is available
if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then
echo "❌ Docker Compose is not installed!"
echo "Please install Docker Compose from: https://docs.docker.com/compose/install/"
exit 1
fi
echo "✅ Docker is installed"
echo ""
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ .env file not found!"
echo ""
echo "Creating .env from .env.example..."
cp .env.example .env
echo ""
echo "📝 IMPORTANT: Edit .env file and add your Gemini API key"
echo " Get your free API key from: https://aistudio.google.com/app/apikey"
echo ""
echo " Then run this script again!"
exit 1
fi
# Check if API key is set
if grep -q "your_gemini_api_key_here" .env; then
echo "⚠️ Gemini API key not configured!"
echo ""
echo "📝 Please edit .env file and replace 'your_gemini_api_key_here' with your actual API key"
echo " Get your free API key from: https://aistudio.google.com/app/apikey"
echo ""
exit 1
fi
echo "✅ Configuration file found"
echo ""
# Stop any existing containers
echo "🛑 Stopping existing containers..."
docker-compose down 2>/dev/null
# Build and start
echo "🏗️ Building Docker image (this may take a few minutes on first run)..."
docker-compose build
echo ""
echo "🚀 Starting Bot Civilization Platform..."
docker-compose up -d
echo ""
echo "⏳ Waiting for application to start (30 seconds)..."
sleep 30
# Check if container is running
if docker-compose ps | grep -q "Up"; then
echo ""
echo "✅ SUCCESS! Bot Civilization Platform is running!"
echo ""
echo "🌐 Access the application:"
echo " Frontend: http://localhost:3000"
echo " API Health: http://localhost:3000/api/health"
echo ""
echo "🔐 Default Login:"
echo " Username: admin"
echo " Password: admin123"
echo ""
echo "📊 View logs:"
echo " docker-compose logs -f"
echo ""
echo "🛑 Stop application:"
echo " docker-compose down"
echo ""
else
echo ""
echo "❌ Failed to start! Check logs:"
echo " docker-compose logs"
echo ""
fi