diff --git a/Dockerfile b/Dockerfile index 7942cc4..7ba48d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,6 +48,9 @@ COPY --from=builder --chown=regisflow:nodejs /build/server/prod-start.js ./serve COPY --from=builder --chown=regisflow:nodejs /build/drizzle.config.ts ./ COPY --from=builder --chown=regisflow:nodejs /build/node_modules ./node_modules +# Copier les assets client au bon endroit pour serveStatic +COPY --from=builder --chown=regisflow:nodejs /build/dist/public ./public + # Les dépendances sont déjà copiées depuis le builder # Nettoyer le cache npm uniquement RUN npm cache clean --force && \ diff --git a/attached_assets/_regisflow-app_logs (1)_1752101017149.txt b/attached_assets/_regisflow-app_logs (1)_1752101017149.txt new file mode 100644 index 0000000..1270ab2 --- /dev/null +++ b/attached_assets/_regisflow-app_logs (1)_1752101017149.txt @@ -0,0 +1,91 @@ + at file:///app/dist/index.js:1081:5 + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +Node.js v18.20.8 +🚀 Démarrage de RegisFlow (mode simplifié)... +📡 Attente de la base de données... +✅ PostgreSQL prêt! +📦 Création des tables de la base de données... +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 +✅ Tables créées avec succès +✅ Base de données configurée +🎯 Démarrage de RegisFlow... +✅ Node.js 18 compatibility fix applied +file:///app/dist/index.js:1032 + throw new Error( + ^ +Error: Could not find the build directory: /app/public, make sure to build the client first + at serveStatic (file:///app/dist/index.js:1032:11) + at file:///app/dist/index.js:1081:5 + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +Node.js v18.20.8 +🚀 Démarrage de RegisFlow (mode simplifié)... +📡 Attente de la base de données... +✅ PostgreSQL prêt! +📦 Création des tables de la base de données... +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 +✅ Tables créées avec succès +✅ Base de données configurée +🎯 Démarrage de RegisFlow... +✅ Node.js 18 compatibility fix applied +file:///app/dist/index.js:1032 + throw new Error( + ^ +Error: Could not find the build directory: /app/public, make sure to build the client first + at serveStatic (file:///app/dist/index.js:1032:11) + at file:///app/dist/index.js:1081:5 + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +Node.js v18.20.8 +🚀 Démarrage de RegisFlow (mode simplifié)... +📡 Attente de la base de données... +✅ PostgreSQL prêt! +📦 Création des tables de la base de données... +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 +✅ Tables créées avec succès +✅ Base de données configurée +🎯 Démarrage de RegisFlow... +✅ Node.js 18 compatibility fix applied +file:///app/dist/index.js:1032 + throw new Error( + ^ +Error: Could not find the build directory: /app/public, make sure to build the client first + at serveStatic (file:///app/dist/index.js:1032:11) + at file:///app/dist/index.js:1081:5 + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +Node.js v18.20.8 +🚀 Démarrage de RegisFlow (mode simplifié)... +📡 Attente de la base de données... +✅ PostgreSQL prêt! +📦 Création des tables de la base de données... +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 +✅ Tables créées avec succès +✅ Base de données configurée +🎯 Démarrage de RegisFlow... +✅ Node.js 18 compatibility fix applied +file:///app/dist/index.js:1032 + throw new Error( + ^ +Error: Could not find the build directory: /app/public, make sure to build the client first + at serveStatic (file:///app/dist/index.js:1032:11) + at file:///app/dist/index.js:1081:5 + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +Node.js v18.20.8 diff --git a/replit.md b/replit.md index fa6e4a3..1b1d995 100644 --- a/replit.md +++ b/replit.md @@ -231,6 +231,14 @@ Preferred communication style: Simple, everyday language. - ✅ Created comprehensive Docker test guide with troubleshooting steps - ✅ Production-ready solution that works with Node.js 18 in Docker containers +### Docker Production Deployment Fix (January 9, 2025) +- ✅ Fixed "relation 'users' does not exist" error by adding drizzle-kit to production dependencies +- ✅ Added automatic database migration in docker-entrypoint-simple.sh script +- ✅ Resolved "Could not find build directory /app/public" by copying assets to correct location +- ✅ Updated Dockerfile to copy dist/public to /app/public for serveStatic compatibility +- ✅ Database tables now created automatically on first container startup +- ✅ Complete Docker deployment package ready with all fixes applied + ### Production Deployment System (January 9, 2025) - ✅ Multi-stage Dockerfile optimized for production with security hardening - ✅ Production-specific Docker Compose configuration with resource limits