File size: 1,333 Bytes
1a27ebc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# ============================================================================

#!/bin/bash

# HackRx 6.0 Deployment Script
echo "πŸš€ Starting HackRx 6.0 Deployment..."

# Check if .env file exists
if [ ! -f .env ]; then
    echo "❌ .env file not found. Please create one with your API keys."
    echo "Required variables:"
    echo "- OPENAI_API_KEY"
    echo "- PINECONE_API_KEY (optional)"
    echo "- PINECONE_ENVIRONMENT (optional)"
    exit 1
fi

# Install dependencies
echo "πŸ“¦ Installing dependencies..."
pip install -r requirements.txt

# Run tests (if available)
if [ -f "tests/test_main.py" ]; then
    echo "πŸ§ͺ Running tests..."
    python -m pytest tests/ -v
fi

# Start the application
echo "πŸ”„ Starting FastAPI application..."
if [ "$1" == "production" ]; then
    echo "🏭 Production mode"
    uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4
elif [ "$1" == "docker" ]; then
    echo "🐳 Docker mode"
    docker-compose up --build -d
    echo "βœ… Application started with Docker Compose"
    echo "πŸ“Š Check health: curl http://localhost:8000/health"
    echo "πŸ“ˆ Check metrics: curl http://localhost:8000/metrics"
else
    echo "πŸ”§ Development mode"
    uvicorn main:app --host 0.0.0.0 --port 8000 --reload
fi

# ============================================================================