#!/bin/bash
set -e

# Padelnomics Deployment Script

echo "🚀 Deploying Padelnomics..."

# Pull latest code
git pull origin main

# Build and restart containers
docker compose build
docker compose up -d

# Run migrations
docker compose exec app uv run python -m padelnomics.migrations.migrate

# Health check
sleep 5
curl -f http://localhost:5000/health || exit 1

echo "✅ Deployment complete!"
