feat(prod): production deployment fixes - env loader, mongoose module, CSS static files, security hardening, PDF export, new UI components

This commit is contained in:
Rafif-Riqullah-Siregar committed 2026-07-16 13:14:34 +07:00
1 parent a403f752f3
commit 46f33eb088
69 files changed
+7367 -744

No files matched your search

+71 -17
View File
@@ -1,22 +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",
env_file: ".env.production"
},
{
name: "backone-backend",
script: "./backend/server.js",
env_file: ".env.production"
},
{
name: "backone-frontend",
script: "server.js",
env_file: ".env.production",
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: {
PORT: 8009
}
}
]
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,
},
],
};