feat: update start script for production and add PM2 management commands

This commit is contained in:
Astrian Zheng 2025-01-12 14:11:48 +11:00
parent 83f53a46ea
commit 2e627663d8
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA
2 changed files with 1041 additions and 2 deletions

1035
backend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,12 @@
"main": "index.ts",
"scripts": {
"build": "tsc",
"start": "node dist/app.js",
"start": "tsc --build && NODE_ENV=production pm2 start dist/app.js --name invoiceIssuer",
"dev": "DEBUG=invoiceIssuer:* nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/app.ts",
"docs": "typedoc"
"docs": "typedoc",
"preparedb": "prisma migrate dev --name init",
"stop": "pm2 stop invoiceIssuer && pm2 delete invoiceIssuer",
"clear": "rm -rf dist"
},
"devDependencies": {
"@types/debug": "^4.1.12",
@ -16,6 +19,7 @@
"@types/node": "^14.0.0",
"@types/nodemailer": "^6.4.17",
"nodemon": "^3.1.9",
"pm2": "^5.4.3",
"prisma": "^6.2.1",
"ts-node": "^10.0.0",
"typedoc": "^0.27.6",