Files
larablog/ecosystem.config.cjs
T
ak 263b98b218 Initial baseline: LaraBlog core with plugin commerce surface.
Captures the current working tree after theme slots, ArticleAccess, and the payment / paid-content plugins so subsequent work has a reviewable git history.
2026-08-12 01:15:38 +08:00

78 lines
1.9 KiB
JavaScript

/**
* PM2 process file for LaraBlog long-running workers.
*
* Usage (from project root):
* pm2 start ecosystem.config.cjs
* pm2 save
* pm2 startup
*
* Notes:
* - Web HTTP is served by nginx/php-fpm (or Herd), NOT pm2.
* - Adjust cwd if deploying outside this path.
*/
const path = require('path');
const root = __dirname;
const php = process.env.PHP_BINARY || 'php';
module.exports = {
apps: [
{
name: 'larablog-queue',
cwd: root,
script: php,
args: 'artisan queue:work redis --queue=default,ai-content,ai-moderation --sleep=3 --tries=3 --max-time=3600',
interpreter: 'none',
instances: 1,
autorestart: true,
max_restarts: 20,
min_uptime: '10s',
kill_timeout: 10000,
out_file: path.join(root, 'storage/logs/pm2-queue.out.log'),
error_file: path.join(root, 'storage/logs/pm2-queue.err.log'),
merge_logs: true,
time: true,
env: {
APP_ENV: 'production',
},
},
{
name: 'larablog-schedule',
cwd: root,
script: php,
args: 'artisan schedule:work',
interpreter: 'none',
instances: 1,
autorestart: true,
max_restarts: 20,
min_uptime: '10s',
out_file: path.join(root, 'storage/logs/pm2-schedule.out.log'),
error_file: path.join(root, 'storage/logs/pm2-schedule.err.log'),
merge_logs: true,
time: true,
env: {
APP_ENV: 'production',
},
},
{
name: 'larablog-ai-workerman',
cwd: root,
script: php,
args: 'artisan workerman:ai start',
interpreter: 'none',
instances: 1,
autorestart: true,
max_restarts: 30,
min_uptime: '5s',
kill_timeout: 15000,
out_file: path.join(root, 'storage/logs/pm2-ai.out.log'),
error_file: path.join(root, 'storage/logs/pm2-ai.err.log'),
merge_logs: true,
time: true,
env: {
APP_ENV: 'production',
},
},
],
};