mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-31 15:03:21 -05:00
* 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>
22 lines
473 B
JavaScript
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'
|
|
}
|
|
]
|
|
};
|