-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
Description:
Currently PM2 only treats files named exactly ecosystem.config.js
as valid ecosystem configuration files. If I run pm2 start ecosystem.dev.js
,
PM2 interprets it as a script instead of a config file and doesn't load all defined apps.
Use case:
I maintain multiple environment-specific config files (ecosystem.dev.js,
ecosystem.test.js, ecosystem.prod.js). I'd like to be able to start/select them via CLI
(e.g. pm2 start --config ecosystem.dev.js
or with --config-file),
similar to how many tools allow a --config
flag.
Expected behavior:
- PM2 should recognize or allow specifying custom config filenames
- Treat them same as
ecosystem.config.js
, i.e. load all apps
Fictive example: ecosystem.dev.js
const path = require('path');
module.exports = {
apps: [
{ name: 'app-dev', cwd: path.resolve(__dirname, '../../backend'), script: 'node server-dev.js' },
{ name: 'worker-dev', script: 'node worker-dev.js' }]};
Expected pm2 start ecosystem.dev.js
to spawn both apps—not run the file itself.
pm2 --version
6.0.8
shailendraverma-iet
Metadata
Metadata
Assignees
Labels
No labels