react-router-serve only honours a port it is given: with PORT unset it calls getAvailablePort(3000) and takes the first free port from 3000 upwards (@react-router/serve cli.js). Nothing in the manual path set PORT, so a busy 3000 silently moved the site to 3001, 3002 and so on, and a reverse proxy configured against one upstream stopped matching. Docker never showed this because apps/web/Dockerfile and docker-compose.yml both set PORT=3000. The web start script now always passes a port - PORT if exported, else WEB_PORT from .env, else 3000 - so the manual path is as deterministic as the containerised one and .env's WEB_PORT finally reaches the process that binds. HOST is deliberately left undefaulted: react-router-serve reads it directly, unset means every interface (what the container needs) and 127.0.0.1 restricts the socket to a proxy on the same host. Verified against the existing build: PORT=8123 listens on *:8123, and WEB_PORT=8124 HOST=127.0.0.1 listens on 127.0.0.1:8124 and serves /en with a 200 while the CMS is down. .env.example documents both variables, and the deployment section of README.md gains a systemd unit, since nothing sources .env there, and a warning that WEB_PORT is the published host port under Docker but the listen port in manual mode. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
30 lines
746 B
JSON
30 lines
746 B
JSON
{
|
|
"name": "web",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "react-router build",
|
|
"dev": "react-router dev --host",
|
|
"start": "PORT=${PORT:-${WEB_PORT:-3000}} react-router-serve ./build/server/index.js",
|
|
"typecheck": "react-router typegen && tsc"
|
|
},
|
|
"dependencies": {
|
|
"@react-router/node": "^8",
|
|
"@react-router/serve": "^8",
|
|
"isbot": "^5.1.36",
|
|
"react": "^19.2.7",
|
|
"react-dom": "^19.2.7",
|
|
"react-router": "^8"
|
|
},
|
|
"devDependencies": {
|
|
"@react-router/dev": "^8",
|
|
"@tailwindcss/vite": "^4.2.2",
|
|
"@types/node": "^22",
|
|
"@types/react": "^19.2.14",
|
|
"@types/react-dom": "^19.2.3",
|
|
"tailwindcss": "^4.2.2",
|
|
"typescript": "^5.9.3",
|
|
"vite": "^8.0.3"
|
|
}
|
|
}
|