fix: use Node.js wrapper for cross-platform PORT fallback

Replace cross-env with a simple Node.js wrapper script that:
- Respects externally supplied PORT environment variable
- Falls back to 8502 if PORT is not set
- Works cross-platform without extra dependencies
- No runtime dependencies beyond Node.js itself

Changes:
- Add start-server.js wrapper script
- Update package.json to use wrapper
- Remove cross-env dependency
- Copy start-server.js in Dockerfile

This fixes both issues:
1. Preserves PORT fallback behavior (PORT can be overridden)
2. No extra runtime dependencies needed
This commit is contained in:
LUIS NOVO 2026-01-14 22:51:39 -03:00
parent 948ab04896
commit 5caf62946e
4 changed files with 11 additions and 28 deletions

View file

@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "cross-env PORT=8502 node .next/standalone/server.js",
"start": "node start-server.js",
"lint": "next lint"
},
"dependencies": {
@ -55,7 +55,6 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"cross-env": "^10.1.0",
"eslint": "^9",
"eslint-config-next": "15.4.2",
"tailwindcss": "^4",