feat(production): sync 10/10 production codebase from demoplace.my.id

This commit is contained in:
rafif committed 2026-07-21 13:30:23 +07:00
commit 0156b84b0e
318 files changed
+56682

No files matched your search

+76
View File
@@ -0,0 +1,76 @@
// ecosystem.config.js — PM2 Production Configuration for BackOne DPI
// Deploy with: pm2 start ecosystem.config.js --env production
// ─────────────────────────────────────────────────────────────────────────────
module.exports = {
apps: [
// ─── 1. Proxy Server (Data Collector) ──────────────────────────────────
{
name: 'backone-proxy',
script: './proxy/index.js',
cwd: '/home/adminbackend/web/demoplace.my.id/public_html',
instances: 1,
exec_mode: 'fork',
watch: false,
node_args: '--max-old-space-size=256',
max_memory_restart: '300M',
restart_delay: 5000,
max_restarts: 10,
env_file: '.env.production',
env: {
NODE_ENV: 'production',
},
error_file: './logs/proxy-error.log',
out_file: './logs/proxy-out.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
merge_logs: true,
},
// ─── 2. Backend API Server (Express — Read-Only MongoDB) ───────────────
{
name: 'backone-backend',
script: './backend/server.js',
cwd: '/home/adminbackend/web/demoplace.my.id/public_html',
instances: 1,
exec_mode: 'fork',
watch: false,
node_args: '--max-old-space-size=256',
max_memory_restart: '400M',
restart_delay: 3000,
max_restarts: 10,
env_file: '.env.production',
env: {
NODE_ENV: 'production',
},
error_file: './logs/backend-error.log',
out_file: './logs/backend-out.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
merge_logs: true,
},
// ─── 3. Next.js Frontend (Standalone) ──────────────────────────────────
{
name: 'backone-frontend',
script: './.next/standalone/server.js',
cwd: '/home/adminbackend/web/demoplace.my.id/public_html',
instances: 1,
exec_mode: 'fork',
watch: false,
node_args: '--max-old-space-size=512',
max_memory_restart: '700M',
restart_delay: 3000,
max_restarts: 10,
env_file: '.env.production',
env: {
NODE_ENV: 'production',
PORT: 3000,
HOSTNAME: '127.0.0.1',
NEXT_TELEMETRY_DISABLED: '1',
},
error_file: './logs/frontend-error.log',
out_file: './logs/frontend-out.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
merge_logs: true,
},
],
};