-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·53 lines (42 loc) · 1.43 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.43 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
#!/bin/bash
# TrainVision AI Deployment Script
set -e
echo "🚂 TrainVision AI Deployment Script"
echo "=================================="
# Check if .env.production exists
if [ ! -f .env.production ]; then
echo "❌ Error: .env.production file not found!"
echo "Please copy .env.production.example to .env.production and configure it."
exit 1
fi
# Load environment variables
source .env.production
# Check required environment variables
if [ -z "$GEMINI_API_KEY" ]; then
echo "❌ Error: GEMINI_API_KEY not set in .env.production"
exit 1
fi
echo "✅ Environment variables loaded"
# Build and start services
echo "🔨 Building Docker images..."
docker-compose -f docker-compose.prod.yml build
echo "🚀 Starting services..."
docker-compose -f docker-compose.prod.yml up -d
echo "⏳ Waiting for services to be healthy..."
sleep 30
# Check service health
echo "🔍 Checking service health..."
if docker-compose -f docker-compose.prod.yml ps | grep -q "Up (healthy)"; then
echo "✅ Services are running and healthy!"
echo ""
echo "🌐 Application URLs:"
echo "Frontend: http://localhost (or your configured domain)"
echo "Backend API: http://localhost:8000"
echo "API Documentation: http://localhost:8000/docs"
echo ""
echo "🎉 Deployment completed successfully!"
else
echo "❌ Some services are not healthy. Check logs:"
docker-compose -f docker-compose.prod.yml logs
exit 1
fi