Skip to content

Commit 5f731c8

Browse files
committedNov 15, 2024·
add pm2
1 parent 1ae6aad commit 5f731c8

File tree

4 files changed

+1111
-2
lines changed

4 files changed

+1111
-2
lines changed
 

‎ecosystem.config.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: "ckhelper",
5+
script: "index.js",
6+
watch: true,
7+
env: {
8+
NODE_ENV: "development",
9+
},
10+
env_production: {
11+
NODE_ENV: "production",
12+
},
13+
},
14+
],
15+
16+
deploy: {
17+
production: {
18+
user: "ubuntu",
19+
host: "ec2-3-39-189-149.ap-northeast-2.compute.amazonaws.com",
20+
ref: "origin/main",
21+
repo: "git@github.com:Jeon-JongChan/ckhelper.git",
22+
path: "/home/ubuntu/build",
23+
"post-setup": "pnpm install",
24+
"pre-deploy-local": "",
25+
"post-deploy":
26+
"pnpm install && pm2 reload ecosystem.config.js --env production",
27+
"pre-setup": "",
28+
},
29+
},
30+
};

‎package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"start": "ts-node src/index.ts"
8+
"start": "ts-node src/index.ts",
9+
"build": "tsc"
910
},
1011
"repository": {
1112
"type": "git",
@@ -32,6 +33,7 @@
3233
},
3334
"devDependencies": {
3435
"@types/ws": "^8.5.13",
36+
"pm2": "^5.4.3",
3537
"ts-node": "^10.9.2"
3638
}
3739
}

‎pnpm-lock.yaml

+1,077
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎script/after-deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cd $REPOSITORY
55

66
sudo pnpm install
77

8-
sudo pnpm start
8+
sudo pm2 start dist/index.js --name ckhelper

0 commit comments

Comments
 (0)
Please sign in to comment.