Files
freeCodeCamp/api-server/ecosystem.config.js
Oliver Eyton-Williams 16dec4ef86 feat: use pnpm to manage pm2 (#49574)
* fix(api): use pnpm to manage pm2

This means that pm2 will get the correct NODE_PATH environment variable.
Also, if we use pnpm to manage node, this ensure that pm2 will use that
node version.

* docs(devops): update api install and update docs

* feat: set node version via npmrc

This means that all scripts (pnpm run ...) will use this node version.
The only way to get other node versions is to invoke `node` directly.

* fix(docs): update api docs for pnpm installation

* feat: use pm2 from root

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-07 14:54:31 -08:00

22 lines
473 B
JavaScript

const fs = require('fs');
const path = require('path');
const dotenv = require('dotenv');
const filePath = path.resolve(__dirname, '..', '.env');
const env = dotenv.parse(fs.readFileSync(filePath));
module.exports = {
apps: [
{
script: `./lib/production-start.js`,
cwd: __dirname,
env,
max_memory_restart: '600M',
instances: 'max',
exec_mode: 'cluster',
name: env.DEPLOYMENT_ENV === 'staging' ? 'dev' : 'org'
}
]
};