mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-22 22:58:16 +02:00
Improve application startup process and fix potential database issues
Refactors Dockerfile and entrypoint script for enhanced reliability, debugging, and single 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
This commit is contained in:
1 parent
037e7e2e49
commit
39cc269d29
4 files changed
+151
-16
No files matched your search
@@ -83,9 +83,3 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|||||||
# Point d'entrée avec script de démarrage
|
# Point d'entrée avec script de démarrage
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
|
|
||||||
# Utiliser dumb-init pour gérer les signaux
|
|
||||||
ENTRYPOINT ["dumb-init", "--"]
|
|
||||||
|
|
||||||
# Démarrer avec le script d'entrée
|
|
||||||
CMD ["docker-entrypoint.sh"]
|
|
||||||
+132
@@ -0,0 +1,132 @@
|
|||||||
|
o config path provided, using default 'drizzle.config.ts'
|
||||||
|
|
||||||
|
Reading config file '/app/drizzle.config.ts'
|
||||||
|
|
||||||
|
Using 'pg' driver for database querying
|
||||||
|
|
||||||
|
[⣷] Pulling schema from database...
|
||||||
|
|
||||||
|
[⣯] Pulling schema from database...
|
||||||
|
|
||||||
|
[⣟] Pulling schema from database...
|
||||||
|
|
||||||
|
[✓] Pulling schema from database...
|
||||||
|
|
||||||
|
[i] No changes detected
|
||||||
|
|
||||||
|
🎯 Starting RegisFlow application...
|
||||||
|
|
||||||
|
🚀 RegisFlow Production Startup
|
||||||
|
|
||||||
|
Database URL: postgresql://regisflow:RegisFl...
|
||||||
|
|
||||||
|
⏳ Waiting for PostgreSQL...
|
||||||
|
|
||||||
|
Database URL: postgresql://regisflow:RegisFlow2024!PostgreSQL@regisflow-db:5432/regisflow
|
||||||
|
|
||||||
|
Connecting to: regisflow-db:5432 as regisflow
|
||||||
|
|
||||||
|
✅ PostgreSQL is ready!
|
||||||
|
|
||||||
|
✅ PostgreSQL is ready!
|
||||||
|
|
||||||
|
🔄 Running database migrations...
|
||||||
|
|
||||||
|
> rest-express@1.0.0 db:push
|
||||||
|
|
||||||
|
> drizzle-kit push
|
||||||
|
|
||||||
|
No config path provided, using default 'drizzle.config.ts'
|
||||||
|
|
||||||
|
Reading config file '/app/drizzle.config.ts'
|
||||||
|
|
||||||
|
Using 'pg' driver for database querying
|
||||||
|
|
||||||
|
[⣷] Pulling schema from database...
|
||||||
|
|
||||||
|
[⣯] Pulling schema from database...
|
||||||
|
|
||||||
|
[✓] Pulling schema from database...
|
||||||
|
|
||||||
|
[i] No changes detected
|
||||||
|
|
||||||
|
🎯 Starting RegisFlow application...
|
||||||
|
|
||||||
|
🚀 RegisFlow Production Startup
|
||||||
|
|
||||||
|
Database URL: postgresql://regisflow:RegisFl...
|
||||||
|
|
||||||
|
⏳ Waiting for PostgreSQL...
|
||||||
|
|
||||||
|
Database URL: postgresql://regisflow:RegisFlow2024!PostgreSQL@regisflow-db:5432/regisflow
|
||||||
|
|
||||||
|
Connecting to: regisflow-db:5432 as regisflow
|
||||||
|
|
||||||
|
✅ PostgreSQL is ready!
|
||||||
|
|
||||||
|
✅ PostgreSQL is ready!
|
||||||
|
|
||||||
|
🔄 Running database migrations...
|
||||||
|
|
||||||
|
> rest-express@1.0.0 db:push
|
||||||
|
|
||||||
|
> drizzle-kit push
|
||||||
|
|
||||||
|
No config path provided, using default 'drizzle.config.ts'
|
||||||
|
|
||||||
|
Reading config file '/app/drizzle.config.ts'
|
||||||
|
|
||||||
|
Using 'pg' driver for database querying
|
||||||
|
|
||||||
|
[⣷] Pulling schema from database...
|
||||||
|
|
||||||
|
[⣯] Pulling schema from database...
|
||||||
|
|
||||||
|
[✓] Pulling schema from database...
|
||||||
|
|
||||||
|
[i] No changes detected
|
||||||
|
|
||||||
|
🎯 Starting RegisFlow application...
|
||||||
|
|
||||||
|
🚀 RegisFlow Production Startup
|
||||||
|
|
||||||
|
Database URL: postgresql://regisflow:RegisFl...
|
||||||
|
|
||||||
|
⏳ Waiting for PostgreSQL...
|
||||||
|
|
||||||
|
Database URL: postgresql://regisflow:RegisFlow2024!PostgreSQL@regisflow-db:5432/regisflow
|
||||||
|
|
||||||
|
Connecting to: regisflow-db:5432 as regisflow
|
||||||
|
|
||||||
|
✅ PostgreSQL is ready!
|
||||||
|
|
||||||
|
✅ PostgreSQL is ready!
|
||||||
|
|
||||||
|
🔄 Running database migrations...
|
||||||
|
|
||||||
|
> rest-express@1.0.0 db:push
|
||||||
|
|
||||||
|
> drizzle-kit push
|
||||||
|
|
||||||
|
No config path provided, using default 'drizzle.config.ts'
|
||||||
|
|
||||||
|
Reading config file '/app/drizzle.config.ts'
|
||||||
|
|
||||||
|
Using 'pg' driver for database querying
|
||||||
|
|
||||||
|
[⣷] Pulling schema from database...
|
||||||
|
|
||||||
|
[⣯] Pulling schema from database...
|
||||||
|
|
||||||
|
[⣟] Pulling schema from database...
|
||||||
|
|
||||||
|
[✓] Pulling schema from database...
|
||||||
|
|
||||||
|
[i] No changes detected
|
||||||
|
|
||||||
|
🎯 Starting RegisFlow application...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+11
-10
@@ -2,27 +2,27 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "🚀 RegisFlow Production Startup"
|
echo "🚀 RegisFlow Production Startup"
|
||||||
echo "Database URL: ${DATABASE_URL:0:30}..."
|
echo "Node.js version: $(node --version)"
|
||||||
|
echo "Current directory: $(pwd)"
|
||||||
|
echo "Available files:"
|
||||||
|
ls -la
|
||||||
|
|
||||||
# Attendre que PostgreSQL soit disponible
|
# Attendre que PostgreSQL soit disponible
|
||||||
echo "⏳ Waiting for PostgreSQL..."
|
echo "⏳ Waiting for PostgreSQL..."
|
||||||
echo "Database URL: $DATABASE_URL"
|
|
||||||
|
|
||||||
# Extraire les paramètres de connexion plus simplement
|
|
||||||
DB_HOST="regisflow-db"
|
DB_HOST="regisflow-db"
|
||||||
DB_PORT="5432"
|
DB_PORT="5432"
|
||||||
DB_USER="regisflow"
|
DB_USER="regisflow"
|
||||||
|
|
||||||
echo "Connecting to: $DB_HOST:$DB_PORT as $DB_USER"
|
echo "Testing connection to: $DB_HOST:$DB_PORT as $DB_USER"
|
||||||
|
|
||||||
# Attendre avec timeout
|
# Attendre avec timeout
|
||||||
RETRIES=30
|
RETRIES=20
|
||||||
while [ $RETRIES -gt 0 ]; do
|
while [ $RETRIES -gt 0 ]; do
|
||||||
if pg_isready -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" > /dev/null 2>&1; then
|
if pg_isready -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" > /dev/null 2>&1; then
|
||||||
echo "✅ PostgreSQL is ready!"
|
echo "✅ PostgreSQL is ready!"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "PostgreSQL is unavailable - sleeping ($((31-RETRIES))/30)"
|
echo "PostgreSQL is unavailable - sleeping ($((21-RETRIES))/20)"
|
||||||
sleep 3
|
sleep 3
|
||||||
RETRIES=$((RETRIES-1))
|
RETRIES=$((RETRIES-1))
|
||||||
done
|
done
|
||||||
@@ -32,11 +32,12 @@ if [ $RETRIES -eq 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "✅ PostgreSQL is ready!"
|
# Migrer la base de données une seule fois
|
||||||
|
|
||||||
# Migrer la base de données
|
|
||||||
echo "🔄 Running database migrations..."
|
echo "🔄 Running database migrations..."
|
||||||
npm run db:push
|
npm run db:push
|
||||||
|
|
||||||
echo "🎯 Starting RegisFlow application..."
|
echo "🎯 Starting RegisFlow application..."
|
||||||
|
echo "Command to execute: $@"
|
||||||
|
|
||||||
|
# Démarrer l'application avec debugging
|
||||||
exec "$@"
|
exec "$@"
|
||||||
@@ -349,6 +349,14 @@ Preferred communication style: Simple, everyday language.
|
|||||||
- ✅ Created .env.example template for environment configuration
|
- ✅ Created .env.example template for environment configuration
|
||||||
- ✅ Optimized Docker Compose for maximum deployment compatibility
|
- ✅ Optimized Docker Compose for maximum deployment compatibility
|
||||||
|
|
||||||
|
### Docker Application Startup Fix (January 13, 2025)
|
||||||
|
- ✅ Fixed application startup loop after database migrations
|
||||||
|
- ✅ Cleaned up duplicate ENTRYPOINT declarations in Dockerfile
|
||||||
|
- ✅ Simplified docker-entrypoint-simple.sh script with proper exec
|
||||||
|
- ✅ Added debugging output to track application startup process
|
||||||
|
- ✅ Reduced PostgreSQL timeout to 60 seconds (20 retries × 3s)
|
||||||
|
- ✅ Enhanced startup script with Node.js version and directory checks
|
||||||
|
|
||||||
### Portainer Deployment Fix (January 10, 2025)
|
### Portainer Deployment Fix (January 10, 2025)
|
||||||
- ✅ Resolved Docker image pull error "regisflow-regisflow:latest" in Portainer
|
- ✅ Resolved Docker image pull error "regisflow-regisflow:latest" in Portainer
|
||||||
- ✅ Created local image building solution with "regisflow:latest" tag
|
- ✅ Created local image building solution with "regisflow:latest" tag
|
||||||
|
|||||||
Reference in new issue
Block a user