add deployment and ecosystem pm2

This commit is contained in:
2026-04-21 14:28:29 +07:00
parent fcdca34460
commit 4993eb444c
2 changed files with 140 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* PM2 ecosystem — jalankan dari root proyek setelah `npm run build`.
* Contoh: pm2 start ecosystem.js
*/
module.exports = {
apps: [
{
name: "setrip",
cwd: __dirname,
script: "node_modules/next/dist/bin/next",
args: "start",
instances: 1,
exec_mode: "fork",
autorestart: true,
watch: false,
max_memory_restart: "512M",
env: {
NODE_ENV: "production",
PORT: 3090,
},
// Override di server produksi, contoh:
// pm2 start ecosystem.js --env production
env_production: {
NODE_ENV: "production",
PORT: 3090,
},
},
],
};