cms.c2sgmbh/ecosystem.config.cjs
Martin Porwoll ce4962e74b feat: BullMQ queue system for email and PDF processing
- Add BullMQ-based job queue with Redis backend
- Implement email worker with tenant-specific SMTP support
- Add PDF worker with Playwright for HTML/URL-to-PDF generation
- Create /api/generate-pdf endpoint with job status polling
- Fix TypeScript errors in Tenants, TenantBreadcrumb, TenantDashboard
- Fix type casts in auditAuthEvents and audit-service
- Remove credentials from ecosystem.config.cjs (now loaded via dotenv)
- Fix ESM __dirname issue with fileURLToPath for PM2 compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 22:59:17 +00:00

57 lines
1.6 KiB
JavaScript

module.exports = {
apps: [
// Main Payload CMS App
{
name: 'payload',
cwd: '/home/payload/payload-cms',
script: 'pnpm',
args: 'start',
env: {
NODE_ENV: 'production',
PORT: 3000
},
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
error_file: '/home/payload/logs/error.log',
out_file: '/home/payload/logs/out.log',
time: true,
max_restarts: 10,
min_uptime: '10s',
restart_delay: 5000
},
// Queue Worker (BullMQ - Email + PDF)
{
name: 'queue-worker',
cwd: '/home/payload/payload-cms',
script: 'npx',
args: 'tsx scripts/run-queue-worker.ts',
env: {
NODE_ENV: 'production',
// Credentials werden via dotenv aus .env geladen (siehe run-queue-worker.ts)
// Queue-spezifische Env Vars
QUEUE_EMAIL_CONCURRENCY: '3',
QUEUE_PDF_CONCURRENCY: '2',
QUEUE_DEFAULT_RETRY: '3',
QUEUE_REDIS_DB: '1',
// Worker aktivieren/deaktivieren
QUEUE_ENABLE_EMAIL: 'true',
QUEUE_ENABLE_PDF: 'true',
// PDF-spezifische Optionen
PDF_OUTPUT_DIR: '/tmp/payload-pdfs',
// PDF_GENERATION_DISABLED: 'true', // Für Tests
},
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '768M', // PDF-Generierung braucht mehr RAM
error_file: '/home/payload/logs/queue-worker-error.log',
out_file: '/home/payload/logs/queue-worker-out.log',
time: true,
max_restarts: 10,
min_uptime: '5s',
restart_delay: 3000,
}
]
}