mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 18:34:13 +00:00
- 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>
57 lines
1.6 KiB
JavaScript
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,
|
|
}
|
|
]
|
|
}
|