From beff43b8dd16e5b880728d6501f7cce3b97bc69e Mon Sep 17 00:00:00 2001 From: mk1020 Date: Thu, 11 Nov 2021 16:18:39 +0200 Subject: [PATCH] add ecosystem.config.js --- ecosystem.config.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ecosystem.config.js diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..874111f --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,35 @@ +module.exports = { + apps : [{ + name: "server", + script: 'app.js', + instances: "max", + exec_mode: "cluster", + watch: '.', + script: './app.js', + restart_delay: 2000, + ignore_watch: ["node_modules"] + env_production: { + NODE_ENV: "production", + HOST: 'localhost', + PORT: 3000, + PGHOST: 'localhost', + PGUSER: 'postgres', + PGDATABASE: 'baby_db', + PGPASSWORD: '14774', + PGPORT: 5432, + PASS_SALT: '/3KrQX8U7PDVvRAkpqY' + } + }], + deploy : { + production : { + user : 'SSH_USERNAME', + host : 'SSH_HOSTMACHINE', + ref : 'origin/master', + repo : 'GIT_REPOSITORY', + path : 'DESTINATION_PATH', + 'pre-deploy-local': '', + 'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production', + 'pre-setup': '' + } + } +}; \ No newline at end of file