Files
CFDivePlatform/openspec/changes/bake-image-remove-bind-mount/specs/scheduler-container/spec.md
T
a620906209 3b0cdf96d8 chore(openspec): 新增 bake-image-remove-bind-mount change 規劃
P0「移除 Docker bind mount、程式碼烘進 image」的完整規劃:Dockerfile
改 multi-stage(app + web)、docker-compose.yml 拿掉五個服務的 bind
mount、nginx 改本地 build 取得 public/、deploy.yml 改 build-then-up、
entrypoint 職責收斂、.dockerignore 補齊。尚未實作,僅規劃文件。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142LC1kQb8EyV59TjHDkhWS
2026-08-04 16:22:50 +08:00

17 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.
## MODIFIED Requirements
### Requirement: Scheduler 以獨立 container 執行
`docker-compose.yml` SHALL 定義 `scheduler` service,使用 `cfdive-platform` image(其中已於 build 階段內嵌完整程式碼,不依賴 `./:/var/www` bind mount),以 `php artisan schedule:work` 前台輪詢方式執行 Laravel Scheduler,取代原本在 app container 內的 cron daemon。
#### Scenario: Scheduler container 隨 app 啟動
- **WHEN** 執行 `docker compose up -d``app` container 已 healthy
- **THEN** `scheduler` container 啟動並持續執行 `php artisan schedule:work`
#### Scenario: App container 重啟時 scheduler 等待就緒
- **WHEN** `app` container 重啟中(unhealthy
- **THEN** `scheduler` container 依 `depends_on` 等待 `app` healthy 後才啟動,避免 scheduler 在 PHP-FPM 未就緒時執行任務
#### Scenario: Scheduler 不依賴主機 bind mount 取得程式碼
- **WHEN** 執行 `docker compose -f docker-compose.yml up -d`production,不含 override
- **THEN** `scheduler` container 執行的排程任務程式碼完全來自 `cfdive-platform` image build 時內嵌的內容,與主機端程式碼目錄是否存在無關