diff --git a/.gitignore b/.gitignore index 469edf6..6a04a01 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ node_modules/ # Logs logs/ *.log +pids/ +*.pid npm-debug.log* # OS diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..da0d63b --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,22 @@ +module.exports = { + apps: [ + { + name: "prology-product-banner", + script: "./server.js", + instances: 1, + exec_mode: "fork", + watch: false, + autorestart: true, + max_memory_restart: "300M", + env: { + NODE_ENV: "production", + }, + // Restart định kỳ mỗi đêm lúc 3:00 AM + cron_restart: "0 3 * * *", + out_file: "./logs/out.log", + error_file: "./logs/error.log", + log_date_format: "YYYY-MM-DD HH:mm:ss", + merge_logs: true, + }, + ], +};