-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.cjs
More file actions
69 lines (66 loc) · 1.77 KB
/
Copy pathecosystem.config.cjs
File metadata and controls
69 lines (66 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* PM2 process file for the production VM (flat layout — no releases).
*
* /home/deploy/canvasflow/
* ├── .env (prod secrets)
* ├── ecosystem.config.cjs ← this file
* ├── apps/api/dist/index.js
* ├── apps/worker/dist/index.js
* ├── apps/web/.next/standalone/apps/web/server.js
* └── packages/database/{drizzle/,migrate.mjs}
*
* HTTP processes bind to 127.0.0.1 only — Nginx (443) terminates TLS
* and reverse-proxies into them. NEVER bind these to 0.0.0.0; the Azure
* NSG should only have 22/80/443 open externally.
*/
const path = require("path");
const BASE = process.env.DEPLOY_DIR || __dirname;
module.exports = {
apps: [
{
name: "canvasflow-api",
cwd: path.join(BASE, "apps/api"),
script: "./dist/index.js",
env: {
...process.env,
NODE_ENV: "production",
PORT: "8000",
},
instances: 1,
exec_mode: "fork",
max_memory_restart: "400M",
max_restarts: 10,
min_uptime: "10s",
},
{
name: "canvasflow-worker",
cwd: path.join(BASE, "apps/worker"),
script: "./dist/index.js",
env: {
...process.env,
NODE_ENV: "production",
},
instances: 1,
exec_mode: "fork",
max_memory_restart: "400M",
max_restarts: 10,
min_uptime: "10s",
},
{
name: "canvasflow-web",
cwd: path.join(BASE, "apps/web/.next/standalone/apps/web"),
script: "./server.js",
env: {
...process.env,
NODE_ENV: "production",
PORT: "3000",
HOSTNAME: "127.0.0.1",
},
instances: 1,
exec_mode: "fork",
max_memory_restart: "500M",
max_restarts: 10,
min_uptime: "10s",
},
],
};