Spaces:
Configuration error
Configuration error
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
# ============================================================================
|