Files
Regisflow/docker-entrypoint-simple.sh
T
michaelschal 766b451768 Improve the application's containerization and startup process
Refactors Dockerfile and entrypoint script for enhanced reliability and Node.js 18 compatibility, including database migration.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/5d315300-98fa-429a-abb0-4fdce6a2e3c9.jpg
2025-07-13 11:34:45 +00:00

21 lines
575 B
Bash

#!/bin/sh
set -e
echo "🚀 RegisFlow Production Startup"
echo "Database URL: ${DATABASE_URL:0:30}..."
# Attendre que PostgreSQL soit disponible
echo "⏳ Waiting for PostgreSQL..."
until pg_isready -h $(echo $DATABASE_URL | cut -d'/' -f3 | cut -d':' -f1) -p $(echo $DATABASE_URL | cut -d':' -f4 | cut -d'/' -f1) > /dev/null 2>&1; do
echo "PostgreSQL is unavailable - sleeping"
sleep 2
done
echo "✅ PostgreSQL is ready!"
# Migrer la base de données
echo "🔄 Running database migrations..."
npm run db:push
echo "🎯 Starting RegisFlow application..."
exec "$@"