-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.js
More file actions
31 lines (31 loc) · 1.24 KB
/
ecosystem.config.js
File metadata and controls
31 lines (31 loc) · 1.24 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
module.exports = {
apps: [
{
name: "chat-service", // Name of the application
script: 'dist/main.js', // './dist/main.js',
// cwd: '/usr/src/chat-service',
// args: "run start:prod", // This explicitly uses the npm script
instances: 'max', // Max instances based on available CPU cores
exec_mode: 'cluster', // Enable cluster mode for multi-core CPUs
watch: false, // Disable watching in production
autorestart: true, // Restart app automatically if it crashes
max_memory_restart: "512M", // Restart if memory exceeds 200MB
env: {
NODE_ENV: "prod", // Environment variable for production
PORT: 3000,
NODE_OPTIONS: '--max-old-space-size=512',
// DATABASE_URL: 'postgres://user:password@postgres:5432/chat_db', // Adjust this based on your setup
// REDIS_URL: 'redis://localhost:6379', // If Redis is added
},
env_local: {
NODE_ENV: "local",
},
env_dev: {
NODE_ENV: "dev",
},
env_debug: {
NODE_ENV: "debug",
},
},
],
};