Skip to content

Commit

Permalink
config: add config pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
lambiengcode committed Apr 11, 2024
1 parent 015513c commit f31154a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
apps: [
{
name: "Websocket",
script: "dist/src/main.js",
instances: 1, // can set is "max" for using max of processors
autorestart: true,
watch: false,
max_memory_restart: "2G",
exec_mode: "cluster",
env: {
NODE_ENV: "production",
},
error_file: "logs/error.log",
out_file: "logs/out.log",
log_date_format: "YYYY-MM-DD HH:mm:ss",
},
],
};

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest-e2e.json",
"pm2": "yarn build && yarn pm2:start",
"pm2:start": "pm2 start ecosystem.config.js"
},
"dependencies": {
"@grpc/grpc-js": "^1.10.5",
Expand Down

0 comments on commit f31154a

Please sign in to comment.