Production image + Forgejo CI #35
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Single-image production build and CI pipeline. This ticket carries M1's exit criteria.
vite build(frontend/) → final image serving Symfony (/api) + static dist (else) via Caddy with SPA fallback./api/health.Exit (M1): production image builds and runs == current version; dev runs locally equivalently; CI green on both halves.
E2E in CI — note from #52 (Playwright setup)
The Playwright e2e harness landed in #52: a
playwrightcompose service (--profile e2e, browsers preinstalled in the image) running the auth smoke test against the live stack. When wiring CI:frontendhealthcheck +depends_on: { frontend: { condition: service_healthy } }on theplaywrightservice. Currentlydepends_on: frontendonly waits for start, not for Vite to be serving on 5173 — fine on a fast dev machine (Playwright's nav retries absorb the race), but a likely intermittent-failure source under CI load.mcr.microsoft.com/playwright:vX.Y.Z-jammy) must stay in sync with@playwright/testine2e/package.json(exact-pinned) — CI should use the same.podman-compose ... --profile e2e run --rm playwright.e2e-<ts>@example.com) — consider a dev/CI DB reset step so theusertable doesn't accumulate over time.Add a
phphealthcheck for CI ordering (from #52 finish-phase review)compose.override.yaml: thephpservice has no healthcheck, andfrontend/playwrightonly wait onfrontendbeing healthy — nothing waits onphpbeing ready. The FrankenPHP entrypoint blocks on DB + migrations before serving, so it's low-risk locally, but as more e2e specs land (#53–#56) they'll hit/apithrough the proxy and could race php boot.For CI: add a
phphealthcheck (e.g. probe a cheap endpoint) and havefrontend+playwrightdepends_onit withcondition: service_healthy, same pattern the frontend healthcheck now uses.(Note: the frontend healthcheck itself was fixed in #52 — it must probe
127.0.0.1, notlocalhost, since the container resolveslocalhost→::1(IPv6) but Vite binds IPv4 only. Use the same127.0.0.1form for any php healthcheck if it probes a Node/IPv4-bound port.)Done — committed to
release/v0.3.0.M1 exit criteria met (verified via live prod-image smoke test):
frontend_builder(node) compiles the SPA → bundled into the FrankenPHP image; fixed a podman/buildah heredoc-shell incompatibility that previously made the prod image unbuildable./api/*+ Mercure, with an SPA fallback (try_files /index.html) —/→ SPA,/login→ SPA fallback, both 200.GET /api/health→ 200{status:ok,db:ok}(503 + server-side log on DB failure)./api/meunauth → 401 with a minimal prod body (APP_DEBUG=0confirmed — no stack trace leak).CI:
.forgejo/workflows/ci.yml(backend cs/stan/test + 95% clover gate, frontend lint/format/tsc/coverage, e2e Playwright against the real prod image) onpush:release/*+pull_request:main;image.ymlbuilds+pushes the prod image onv*tag only.Full suite green (249 tests, 100% backend line coverage), PHPStan L6 clean, CS clean, frontend 45 tests green.
Note: the Forgejo CI pipeline itself has not yet executed on the real runner — first
release/*push is its first live run.