Files
larablog/docs/ops/deploy.md
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

1.2 KiB
Raw Blame History

部署与进程管理

Web

  • nginx + php-fpm(或 Laravel Herd
  • 参考 deploy/nginx.conf
  • 附件:生产 ATTACHMENTS_DRIVER=s3;开发可用 local

长驻进程(PM2

配置文件:仓库根目录 ecosystem.config.cjs

# 建议 QUEUE_CONNECTION=redis,并先起 Redis
composer install --no-dev --optimize-autoloader
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan themes:publish
php artisan plugins:sync

pm2 start ecosystem.config.cjs
pm2 save

进程:

name 作用
larablog-queue queue:workdefault / ai-content / ai-moderation
larablog-schedule schedule:work
larablog-ai-workerman Workerman AI 运行时(可选,若只用 queue:work 可删)

HTTP 不要交给 pm2。

GitHub Actions

  • .github/workflows/ci.ymlPHP 8.2/8.3 跑 PHPUnitsqlite memory
  • deploy job 仅作占位,需绑定 production environment 与自有发布脚本

Redis 键前缀

.env

REDIS_PREFIX=larablog_
CACHE_PREFIX=larablog_cache_

Laravel 会在 config/database.phpredis.options.prefix 与 cache prefix 生效。