bae705aa97
- Add NFC ePassport roadmap (ICAO 9303, eIDAS) - Add TensorFlow.js edge face detection (BlazeFace) - Add structured audit logger (GDPR-compliant) - Risk scoring support Part of KYC Apple Native UX v1.1.0
90 lines
2.2 KiB
Bash
Executable File
90 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "=== IOM Production Deployment ==="
|
|
|
|
# Check environment
|
|
if [ "$ENVIRONMENT" != "production" ]; then
|
|
echo "Warning: ENVIRONMENT is not set to production"
|
|
echo "Set ENVIRONMENT=production and try again"
|
|
exit 1
|
|
fi
|
|
|
|
# Load environment
|
|
source .env
|
|
|
|
# Pre-deployment checks
|
|
echo "Running pre-deployment checks..."
|
|
|
|
# Check SSL certificates
|
|
if [ ! -f "ssl/server.crt" ] || [ ! -f "ssl/server.key" ]; then
|
|
echo "Error: SSL certificates not found"
|
|
echo "Run: ./ssl/generate_ssl.sh"
|
|
exit 1
|
|
fi
|
|
|
|
# Check database backup
|
|
echo "Creating pre-deployment backup..."
|
|
./scripts/backup_auto.sh
|
|
|
|
# Pull latest images
|
|
echo "Pulling latest images..."
|
|
docker-compose -f docker-compose.selfhosted.yml pull
|
|
|
|
# Run database migrations
|
|
echo "Running database migrations..."
|
|
docker-compose -f docker-compose.selfhosted.yml run --rm api alembic upgrade head
|
|
|
|
# Start services
|
|
echo "Starting production services..."
|
|
docker-compose -f docker-compose.selfhosted.yml up -d
|
|
|
|
# Wait for services
|
|
echo "Waiting for services to start..."
|
|
sleep 15
|
|
|
|
# Health checks
|
|
echo "Running health checks..."
|
|
|
|
services=("postgres" "redis" "api" "nginx" "minio" "elasticsearch")
|
|
for service in "${services[@]}"; do
|
|
if docker-compose -f docker-compose.selfhosted.yml ps | grep -q "$service.*Up"; then
|
|
echo "✓ $service is running"
|
|
else
|
|
echo "✗ $service failed to start"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
# API health check
|
|
if curl -s http://localhost:8000/health | grep -q "healthy"; then
|
|
echo "✓ API is healthy"
|
|
else
|
|
echo "✗ API health check failed"
|
|
exit 1
|
|
fi
|
|
|
|
# SSL check
|
|
if curl -s -k https://localhost/health | grep -q "healthy"; then
|
|
echo "✓ SSL is working"
|
|
else
|
|
echo "✗ SSL check failed"
|
|
exit 1
|
|
fi
|
|
|
|
# Run smoke tests
|
|
echo "Running smoke tests..."
|
|
curl -s http://localhost:8000/taxonomy/domains | grep -q "BYG"
|
|
curl -s http://localhost:8000/health | grep -q "healthy"
|
|
|
|
echo ""
|
|
echo "=== Production Deployment Complete ==="
|
|
echo "API: https://api.landvex.com"
|
|
echo "Dashboard: https://admin.landvex.com"
|
|
echo "Monitoring: https://grafana.landvex.com"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Configure DNS"
|
|
echo "2. Set up monitoring alerts"
|
|
echo "3. Test with real data"
|