-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.cjs
More file actions
45 lines (36 loc) · 1.25 KB
/
Copy pathecosystem.config.cjs
File metadata and controls
45 lines (36 loc) · 1.25 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
// =============================================================================
// PM2 Ecosystem Configuration — Timin Next.js Application
// Usage: pm2 start ecosystem.config.cjs
// pm2 reload ecosystem.config.cjs (zero-downtime deploy)
// =============================================================================
module.exports = {
apps: [
{
// Display name in PM2 process list
name: "timin",
// Next.js CLI entry point (Windows compatible)
script: "node_modules/next/dist/bin/next",
// CLI arguments passed to the script
args: "start -p 3000",
// Run single instance in fork mode
instances: 1,
exec_mode: "fork",
// Environment variables
env: {
DEPLOY_TARGET: "server",
NODE_ENV: "production",
},
// Load environment variables from .env.local
env_file: ".env.local",
// Merge PM2's own env on top (don't wipe process.env)
merge_logs: true,
// Restart automatically if the app crashes
autorestart: true,
// Wait before considering a restart successful (ms)
min_uptime: "10s",
// Maximum number of restarts within the window before giving up
max_restarts: 10,
restart_delay: 1000,
},
],
};