Port interne de l'application : 3000 → 8321

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fkg15RCxNgUys4ru73He2o
This commit is contained in:
Claude committed 2026-07-10 20:15:36 +00:00
1 parent 478ec3e307
commit e3f5869bc8
5 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -26,5 +26,5 @@ COPY --from=webbuild /build/dist ./public
# this ownership on first use # this ownership on first use
RUN mkdir -p /data/uploads && chown node:node /data/uploads RUN mkdir -p /data/uploads && chown node:node /data/uploads
USER node USER node
EXPOSE 3000 EXPOSE 8321
CMD ["node", "src/index.js"] CMD ["node", "src/index.js"]
+2 -2
View File
@@ -31,7 +31,7 @@ Le conteneur `app` est aussi rattaché au réseau externe `nginx_default`
stack nginx, pointez simplement l'upstream vers : stack nginx, pointez simplement l'upstream vers :
```nginx ```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` 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 : # Terminal 1 — base de données PostgreSQL locale + variables d'env, puis :
cd server && npm install && npm start cd server && npm install && npm start
# Terminal 2 # 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 ## Structure
+4 -4
View File
@@ -47,7 +47,7 @@ services:
restart: unless-stopped restart: unless-stopped
environment: environment:
NODE_ENV: production NODE_ENV: production
PORT: "3000" PORT: "8321"
DATABASE_URL: postgres://sbc_app:${APP_DB_PASSWORD:-sbc-app-9e12d47ab8c3f605}@db:5432/sbc 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 # Empty by default: the app then generates a random ephemeral secret at
# startup. Set a fixed value to keep sessions across restarts. # startup. Set a fixed value to keep sessions across restarts.
@@ -60,12 +60,12 @@ services:
volumes: volumes:
- uploads:/data/uploads - uploads:/data/uploads
ports: ports:
- "${APP_PORT:-8321}:3000" - "${APP_PORT:-8321}:8321"
networks: networks:
default: default:
proxy: proxy:
aliases: 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 - sbc-app
depends_on: depends_on:
db: db:
@@ -78,7 +78,7 @@ services:
security_opt: security_opt:
- no-new-privileges:true - no-new-privileges:true
healthcheck: 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 interval: 10s
timeout: 5s timeout: 5s
retries: 6 retries: 6
+1 -1
View File
@@ -22,7 +22,7 @@ if (jwtSecret.length < 32) {
} }
export const config = { export const config = {
port: Number(process.env.PORT || 3000), port: Number(process.env.PORT || 8321),
databaseUrl: required('DATABASE_URL'), databaseUrl: required('DATABASE_URL'),
jwtSecret, jwtSecret,
cookieSecure: process.env.COOKIE_SECURE === 'true', cookieSecure: process.env.COOKIE_SECURE === 'true',
+2 -2
View File
@@ -5,8 +5,8 @@ export default defineConfig({
plugins: [react()], plugins: [react()],
server: { server: {
proxy: { proxy: {
'/api': 'http://localhost:3000', '/api': 'http://localhost:8321',
'/uploads': 'http://localhost:3000', '/uploads': 'http://localhost:8321',
}, },
}, },
build: { build: {