2024-03-28 12:48:22 +08:00
|
|
|
const { cpus } = require('os');
|
2024-02-28 08:32:35 +08:00
|
|
|
|
2024-03-28 12:48:22 +08:00
|
|
|
const cpuLen = cpus().length;
|
2024-02-28 08:32:35 +08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
apps: [
|
|
|
|
{
|
2024-02-28 11:53:50 +08:00
|
|
|
name: 'huaxin-admin',
|
2024-02-28 08:32:35 +08:00
|
|
|
script: './dist/main.js',
|
|
|
|
autorestart: true,
|
|
|
|
exec_mode: 'cluster',
|
|
|
|
watch: false,
|
2024-03-28 12:48:22 +08:00
|
|
|
instances: process.env.CPU_LEN ?? cpuLen,
|
2024-02-28 08:32:35 +08:00
|
|
|
max_memory_restart: '520M',
|
|
|
|
args: '',
|
|
|
|
env: {
|
|
|
|
NODE_ENV: 'production',
|
2024-03-28 12:48:22 +08:00
|
|
|
PORT: process.env.APP_PORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|