Files
Regisflow/docker-test-quick.sh
T
michaelschal f7972c66da Improve application startup reliability and database migration handling
Simplifies the Dockerfile, adds robust migration error handling, and ensures application startup.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 4b008663-bd72-492b-b0b6-fa252367e730
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/4b008663-bd72-492b-b0b6-fa252367e730/MSYevTt
2025-07-19 14:24:09 +00:00

63 lines
1.7 KiB
Bash

#!/bin/bash
set -e
echo "🐳 RegisFlow Docker Quick Test"
echo "=============================="
# Nettoyer les anciens containers
echo "🧹 Cleaning up existing containers..."
docker-compose down -v 2>/dev/null || true
docker system prune -f >/dev/null 2>&1 || true
# Test de build avec l'approche simplifiée (skip migrations)
echo "🔨 Building fresh Docker image (simple approach - skip migrations)..."
if docker-compose build --no-cache regisflow; then
echo "✅ Build successful"
else
echo "❌ Build failed"
exit 1
fi
# Créer .env.production si nécessaire
if [[ ! -f ".env.production" ]]; then
echo "📝 Creating .env.production from example..."
cp .env.production.example .env.production
fi
# Test de démarrage
echo "🚀 Starting containers..."
if docker-compose up -d; then
echo "✅ Containers started"
# Attendre l'application
echo "⏳ Waiting for application..."
for i in {1..30}; do
if curl -s http://localhost:5000/health >/dev/null 2>&1; then
echo "✅ Application is responding!"
echo "🏥 Health: $(curl -s http://localhost:5000/health | grep -o '"status":"[^"]*"' || echo 'OK')"
break
fi
echo " Attempt $i/30..."
sleep 2
done
if [ $i -eq 30 ]; then
echo "❌ Application timeout"
echo "📋 Recent logs:"
docker-compose logs --tail=10 regisflow
exit 1
fi
else
echo "❌ Container startup failed"
exit 1
fi
echo ""
echo "🎉 SUCCESS! RegisFlow is running"
echo "================================"
echo "Access: http://localhost:5000"
echo "Admin: admin / admin123"
echo ""
echo "To stop: docker-compose down"
echo "To see logs: docker-compose logs -f"