-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
When deploying applications with container orchestration systems, certain environment variable names are reserved by the system and cannot be used. The current configuration uses PORT which is one of these reserved names, causing deployment failures and automatic rollbacks.
Best Practices
It's generally considered bad practice to use common system names like PORT, HOST, PATH, etc. for custom environment variables, as they can conflict with system internals.
Suggested Solutions
Option 1: Rename the variable
Change PORT to one of these alternatives:
APP_PORTSERVER_PORTLISTEN_PORT
Option 2: Legacy support
Keep PORT as default but set by default a port number.
const port = process.env.PORT || 3000;
Option 3: Extended legacy support
Keep PORT as default but allow overriding with a custom name, maintaining backward compatibility
const port = process.env.PORT || process.env.<APP_PORT | SERVER_PORT | LISTEN_PORT> || 3000;
Metadata
Metadata
Assignees
Labels
No labels