From 1ee5972c47d179eddc836250ab2244c82febf4ea Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 9 Jul 2025 22:45:33 +0000 Subject: [PATCH] Ensure website content displays correctly when running in production mode Fixes a static asset serving issue by updating the Dockerfile to copy public assets. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/1a628c74-3aad-4182-a42f-aeae036e6dcf.jpg --- Dockerfile | 3 + .../_regisflow-app_logs (1)_1752101017149.txt | 91 +++++++++++++++++++ replit.md | 8 ++ 3 files changed, 102 insertions(+) create mode 100644 attached_assets/_regisflow-app_logs (1)_1752101017149.txt 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