From c041256bcefaded1b52cd0f10036723c702429a9 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Sun, 13 Jul 2025 12:12:20 +0000 Subject: [PATCH] Update the application to use port 3000 across all services Adjusts port configurations from 5000 to 3000 in .replit, Dockerfile, docker-compose.yml, replit.md and server/index.ts for consistent service deployment. 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 --- .replit | 4 ++++ Dockerfile | 6 +++--- docker-compose.yml | 6 +++--- replit.md | 2 ++ server/index.ts | 5 ++--- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.replit b/.replit index 51f344f..ad364d4 100644 --- a/.replit +++ b/.replit @@ -10,6 +10,10 @@ deploymentTarget = "autoscale" build = ["npm", "run", "build"] run = ["npm", "run", "start"] +[[ports]] +localPort = 3000 +externalPort = 3000 + [[ports]] localPort = 5000 externalPort = 80 diff --git a/Dockerfile b/Dockerfile index 45d7ae0..f6ac704 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,11 +64,11 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh USER regisflow # Exposer le port -EXPOSE 5000 +EXPOSE 3000 # Variables d'environnement de production ENV NODE_ENV=production -ENV PORT=5000 +ENV PORT=3000 ENV NODE_OPTIONS="--max-old-space-size=512" # Labels pour la documentation @@ -78,7 +78,7 @@ LABEL description="Application RegisFlow pour la gestion des ventes de feux d'ar # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:5000/ || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1 # Point d'entrée avec script de démarrage ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 686e7d7..b6bbade 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: pull_policy: never environment: NODE_ENV: production - PORT: 5000 + PORT: 3000 DATABASE_URL: postgresql://regisflow:${POSTGRES_PASSWORD:-RegisFlow2024!PostgreSQL}@regisflow-db:5432/regisflow SESSION_SECRET: ${SESSION_SECRET:-RegisFlow2024SessionSecretKey1234567890ABCDEF} TZ: ${TZ:-Europe/Paris} @@ -50,10 +50,10 @@ services: - backup_data:/app/backups - logs_data:/app/logs ports: - - "5000:5000" + - "3000:3000" restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5000/ || exit 1"] + test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1"] interval: 30s timeout: 10s retries: 5 diff --git a/replit.md b/replit.md index c64ece4..1d92b0d 100644 --- a/replit.md +++ b/replit.md @@ -356,6 +356,8 @@ Preferred communication style: Simple, everyday language. - ✅ 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 +- ✅ Corrected port configuration from 5000 to 3000 for proper deployment +- ✅ Updated all Docker and application configurations to use port 3000 ### Portainer Deployment Fix (January 10, 2025) - ✅ Resolved Docker image pull error "regisflow-regisflow:latest" in Portainer diff --git a/server/index.ts b/server/index.ts index 2b3db55..497330c 100644 --- a/server/index.ts +++ b/server/index.ts @@ -58,10 +58,9 @@ app.use((req, res, next) => { serveStatic(app); } - // ALWAYS serve the app on port 5000 + // ALWAYS serve the app on port 3000 // this serves both the API and the client. - // It is the only port that is not firewalled. - const port = 5000; + const port = process.env.PORT ? parseInt(process.env.PORT) : 3000; server.listen({ port, host: "0.0.0.0",