From e4009bc40e77ed0f3a4f828b0c28521b444b6ca1 Mon Sep 17 00:00:00 2001 From: fatchan Date: Mon, 6 May 2019 11:02:58 +0000 Subject: [PATCH] add ecosystem with production env and easier to start deleter and clustered server --- ecosystem.config.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ecosystem.config.js diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 00000000..06764043 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,32 @@ +module.exports = { + // Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/ + apps : [{ + name: 'chan', + script: 'server.js', + instances: 2, + autorestart: true, + watch: false, + max_memory_restart: '1G', + log_date_format: 'YYYY-MM-DD HH:mm:ss', + env: { + NODE_ENV: 'development' + }, + env_production: { + NODE_ENV: 'production' + } + }, { + name: 'deleter', + script: 'deletescheduler.js', + instances: 1, + autorestart: true, + watch: false, + max_memory_restart: '1G', + log_date_format: 'YYYY-MM-DD HH:mm:ss', + env: { + NODE_ENV: 'development' + }, + env_production: { + NODE_ENV: 'production' + } + }] +};