Initial project setup with dependencies and deployment config
This commit is contained in:
39
ecosystem.config.js
Normal file
39
ecosystem.config.js
Normal file
@@ -0,0 +1,39 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
// Single process: API + Worker together (good for your server size)
|
||||
// To split later: separate into api + worker entries
|
||||
name: "imgforge",
|
||||
script: "src/index.js",
|
||||
cwd: "/opt/apps/imgforge",
|
||||
env: {
|
||||
NODE_ENV: "production",
|
||||
PORT: 5100,
|
||||
},
|
||||
// Restart on crashes
|
||||
max_restarts: 10,
|
||||
restart_delay: 2000,
|
||||
// Log rotation
|
||||
log_date_format: "YYYY-MM-DD HH:mm:ss",
|
||||
error_file: "/opt/logs/apps/imgforge-error.log",
|
||||
out_file: "/opt/logs/apps/imgforge-out.log",
|
||||
merge_logs: true,
|
||||
},
|
||||
|
||||
// Uncomment below to run worker as a separate process for heavier loads:
|
||||
// {
|
||||
// name: "imgforge-worker",
|
||||
// script: "src/workers/image.worker.js",
|
||||
// cwd: "/opt/apps/imgforge",
|
||||
// env: {
|
||||
// NODE_ENV: "production",
|
||||
// },
|
||||
// instances: 1,
|
||||
// max_restarts: 10,
|
||||
// restart_delay: 2000,
|
||||
// error_file: "/opt/logs/apps/imgforge-worker-error.log",
|
||||
// out_file: "/opt/logs/apps/imgforge-worker-out.log",
|
||||
// merge_logs: true,
|
||||
// },
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user