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

46 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 部署与进程管理
## Web
- nginx + php-fpm(或 Laravel Herd
- 参考 `deploy/nginx.conf`
- 附件:生产 `ATTACHMENTS_DRIVER=s3`;开发可用 `local`
## 长驻进程(PM2
配置文件:仓库根目录 `ecosystem.config.cjs`
```bash
# 建议 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:work`default / ai-content / ai-moderation |
| `larablog-schedule` | `schedule:work` |
| `larablog-ai-workerman` | Workerman AI 运行时(可选,若只用 queue:work 可删) |
> HTTP **不要**交给 pm2。
## GitHub Actions
- `.github/workflows/ci.yml`PHP 8.2/8.3 跑 PHPUnitsqlite memory
- `deploy` job 仅作占位,需绑定 `production` environment 与自有发布脚本
## Redis 键前缀
`.env`
```env
REDIS_PREFIX=larablog_
CACHE_PREFIX=larablog_cache_
```
Laravel 会在 `config/database.php``redis.options.prefix` 与 cache prefix 生效。