add pm2 to keep your application online

This commit is contained in:
Hassan Yousefi 2023-10-09 22:42:17 +03:30
parent 2fe313b696
commit c2e1cbb9c9
3 changed files with 803 additions and 8 deletions

9
ecosystem.config.js Normal file
View file

@ -0,0 +1,9 @@
module.exports = {
apps: [
{
name: 'mmt-server',
script: 'tsx src/index.ts',
max_memory_restart: '300M',
},
],
};

View file

@ -10,7 +10,10 @@
},
"homepage": "https://github.com/hexboy/maven-mirror-tool",
"scripts": {
"start": "tsx src/index.ts"
"start": "pm2 start --attach",
"logs": "pm2 logs",
"monit": "pm2 monit",
"stop": "pm2 delete mmt-server"
},
"dependencies": {
"chalk": "^5.3.0",
@ -19,6 +22,7 @@
"js-yaml": "^4.1.0",
"minimist": "^1.2.8",
"morgan": "^1.10.0",
"pm2": "^5.3.0",
"proxy-agent": "^6.3.1",
"tsx": "^3.12.10",
"typescript": "^5.2.2"

796
yarn.lock

File diff suppressed because it is too large Load diff