-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
73 lines (64 loc) · 1.92 KB
/
deploy.sh
File metadata and controls
73 lines (64 loc) · 1.92 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
#!/bin/bash
# Quick deployment script for VectorDB-Q
set -e
echo "🚀 VectorDB-Q Docker Deployment"
echo "================================"
echo ""
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Error: Docker is not running!"
echo " Please start Docker and try again."
exit 1
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ No .env file found. Creating from template..."
cp .env.example .env
echo "✅ Created .env file"
echo ""
echo "⚠️ IMPORTANT: Edit .env and add your Cohere API key!"
echo " COHERE_API_KEY=your_actual_key_here"
echo ""
read -p "Press Enter after updating .env file..."
fi
# Check if Cohere API key is set
if grep -q "your_cohere_api_key_here" .env; then
echo "⚠️ WARNING: You haven't set your Cohere API key in .env"
echo " The application won't work without it!"
echo ""
read -p "Continue anyway? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
echo ""
echo "📦 Building Docker image..."
docker-compose build
echo ""
echo "🚀 Starting services..."
docker-compose up -d
echo ""
echo "⏳ Waiting for services to be healthy..."
sleep 5
# Check health
if curl -f -s http://localhost:8000/health > /dev/null; then
echo "✅ Service is healthy!"
echo ""
echo "🎉 Deployment successful!"
echo ""
echo "📍 Access your application:"
echo " Frontend: http://localhost:8000/"
echo " API Docs: http://localhost:8000/docs"
echo " Health: http://localhost:8000/health"
echo ""
echo "📋 Useful commands:"
echo " docker-compose logs -f # View logs"
echo " docker-compose restart # Restart services"
echo " docker-compose down # Stop services"
echo ""
else
echo "⚠️ Service is not responding yet"
echo " Check logs: docker-compose logs -f"
echo ""
fi