From e3f5869bc812ba0b6b893797a84d455e10b3fb0c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 20:15:36 +0000 Subject: [PATCH] =?UTF-8?q?Port=20interne=20de=20l'application=20:=203000?= =?UTF-8?q?=20=E2=86=92=208321?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plus aucune référence au port 3000 : l'application écoute sur 8321 dans le conteneur (PORT, EXPOSE, healthcheck, mapping 8321:8321, upstream nginx sbc-app:8321, proxy de dev Vite, README). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Fkg15RCxNgUys4ru73He2o --- Dockerfile | 2 +- README.md | 4 ++-- docker-compose.yml | 8 ++++---- server/src/config.js | 2 +- web/vite.config.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5556517..2f0a757 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,5 +26,5 @@ COPY --from=webbuild /build/dist ./public # this ownership on first use RUN mkdir -p /data/uploads && chown node:node /data/uploads USER node -EXPOSE 3000 +EXPOSE 8321 CMD ["node", "src/index.js"] diff --git a/README.md b/README.md index 9080f96..7af7254 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Le conteneur `app` est aussi rattaché au réseau externe `nginx_default` stack nginx, pointez simplement l'upstream vers : ```nginx -proxy_pass http://sbc-app:3000; +proxy_pass http://sbc-app:8321; ``` Ce réseau doit exister avant le déploiement (`docker network create nginx_default` @@ -161,7 +161,7 @@ formulaire « Mot de passe », endpoint `POST /api/auth/change-password`). # Terminal 1 — base de données PostgreSQL locale + variables d'env, puis : cd server && npm install && npm start # Terminal 2 -cd web && npm install && npm run dev # proxy /api → localhost:3000 +cd web && npm install && npm run dev # proxy /api → localhost:8321 ``` ## Structure diff --git a/docker-compose.yml b/docker-compose.yml index 1c2c431..ce932ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,7 +47,7 @@ services: restart: unless-stopped environment: NODE_ENV: production - PORT: "3000" + PORT: "8321" DATABASE_URL: postgres://sbc_app:${APP_DB_PASSWORD:-sbc-app-9e12d47ab8c3f605}@db:5432/sbc # Empty by default: the app then generates a random ephemeral secret at # startup. Set a fixed value to keep sessions across restarts. @@ -60,12 +60,12 @@ services: volumes: - uploads:/data/uploads ports: - - "${APP_PORT:-8321}:3000" + - "${APP_PORT:-8321}:8321" networks: default: proxy: aliases: - # Stable name for the nginx upstream: proxy_pass http://sbc-app:3000; + # Stable name for the nginx upstream: proxy_pass http://sbc-app:8321; - sbc-app depends_on: db: @@ -78,7 +78,7 @@ services: security_opt: - no-new-privileges:true healthcheck: - test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"] + test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8321/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"] interval: 10s timeout: 5s retries: 6 diff --git a/server/src/config.js b/server/src/config.js index 92e5df2..787ef9e 100644 --- a/server/src/config.js +++ b/server/src/config.js @@ -22,7 +22,7 @@ if (jwtSecret.length < 32) { } export const config = { - port: Number(process.env.PORT || 3000), + port: Number(process.env.PORT || 8321), databaseUrl: required('DATABASE_URL'), jwtSecret, cookieSecure: process.env.COOKIE_SECURE === 'true', diff --git a/web/vite.config.js b/web/vite.config.js index b197f3b..ad0537e 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -5,8 +5,8 @@ export default defineConfig({ plugins: [react()], server: { proxy: { - '/api': 'http://localhost:3000', - '/uploads': 'http://localhost:3000', + '/api': 'http://localhost:8321', + '/uploads': 'http://localhost:8321', }, }, build: {