73 lines
2.2 KiB
Bash
73 lines
2.2 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "🚀 Deploying Virtual Board Member AI System (Development)"
|
|
|
|
# Check if Docker is running
|
|
if ! docker info > /dev/null 2>&1; then
|
|
echo "❌ Docker is not running. Please start Docker and try again."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if required files exist
|
|
if [ ! -f ".env" ]; then
|
|
echo "📝 Creating .env file from template..."
|
|
cp env.example .env
|
|
echo "⚠️ Please update .env file with your configuration values"
|
|
fi
|
|
|
|
# Create necessary directories
|
|
echo "📁 Creating necessary directories..."
|
|
mkdir -p logs uploads temp
|
|
|
|
# Build and start services
|
|
echo "🐳 Starting Docker services..."
|
|
docker-compose -f docker-compose.dev.yml down --remove-orphans
|
|
docker-compose -f docker-compose.dev.yml build --no-cache
|
|
docker-compose -f docker-compose.dev.yml up -d
|
|
|
|
# Wait for services to be healthy
|
|
echo "⏳ Waiting for services to be ready..."
|
|
sleep 30
|
|
|
|
# Check service health
|
|
echo "🔍 Checking service health..."
|
|
docker-compose -f docker-compose.dev.yml ps
|
|
|
|
# Initialize database
|
|
echo "🗄️ Initializing database..."
|
|
docker-compose -f docker-compose.dev.yml exec -T postgres psql -U vbm_user -d vbm_db -f /docker-entrypoint-initdb.d/init-db.sql
|
|
|
|
# Install Python dependencies
|
|
echo "📦 Installing Python dependencies..."
|
|
if command -v poetry &> /dev/null; then
|
|
poetry install
|
|
else
|
|
echo "⚠️ Poetry not found, using pip..."
|
|
pip install -r requirements.txt
|
|
fi
|
|
|
|
# Run database migrations
|
|
echo "🔄 Running database migrations..."
|
|
# TODO: Add Alembic migration commands
|
|
|
|
# Run tests
|
|
echo "🧪 Running tests..."
|
|
python -m pytest tests/ -v
|
|
|
|
echo "✅ Deployment completed successfully!"
|
|
echo ""
|
|
echo "📊 Service URLs:"
|
|
echo " - Application: http://localhost:8000"
|
|
echo " - API Documentation: http://localhost:8000/docs"
|
|
echo " - Health Check: http://localhost:8000/health"
|
|
echo " - Prometheus: http://localhost:9090"
|
|
echo " - Grafana: http://localhost:3000"
|
|
echo " - Kibana: http://localhost:5601"
|
|
echo " - Jaeger: http://localhost:16686"
|
|
echo ""
|
|
echo "🔧 Next steps:"
|
|
echo " 1. Update .env file with your API keys and configuration"
|
|
echo " 2. Start the application: poetry run uvicorn app.main:app --reload"
|
|
echo " 3. Access the API documentation at http://localhost:8000/docs"
|