Skip to content

Add Dockerfile / codegen-write guidance recovered from Marten's pre-9.0 DevOps page (closes #308)#309

Merged
jeremydmiller merged 1 commit into
mainfrom
docs/308-codegen-docker
May 19, 2026
Merged

Add Dockerfile / codegen-write guidance recovered from Marten's pre-9.0 DevOps page (closes #308)#309
jeremydmiller merged 1 commit into
mainfrom
docs/308-codegen-docker

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

Docs-only. Marten 9.0 (marten#4461) removed runtime codegen entirely, and the cleanup PR marten#4498 stripped the dotnet run -- codegen write Dockerfile step from Marten's DevOps guide. That guidance is still broadly applicable to JasperFx-family hosts backed by runtime codegen (Wolverine, custom hosts) — this PR gives it a home in the canonical reference docs. Closes #308.

What's new

New page: docs/codegen/docker.md

  • When to use this — a posture-comparison table positioning codegen write between Dynamic (development), Auto (staging), Static (production cold-start sensitivity), and full AOT (no Roslyn at runtime).
  • The Dockerfile itself — multi-stage build with dotnet run -- codegen write inside the build stage so the published artifacts ship pre-generated. Base images bumped from the recovered 8.0-alpine to 10.0-alpine (current .NET LTS as of 2026-05), with a note to bump as future LTSes land.
  • Build-stage constraint — the host has to construct without external resources because dotnet run -- codegen write builds the DI container. Documents the three usual failure modes (eager AddNpgsqlDataSource, eager singleton factories, eager config providers) and three workarounds (lazy access, args-guarded registration, push-into-IHostedService).
  • Marten-only calloutcodegen write is a no-op for hosts that register only Marten 9.0, so the build-stage line can simply be dropped in that shape.
  • See-also links to cli.md and aot.md.

Wired in

  • docs/.vitepress/config.mts — new sidebar entry under "Code Generation", between "CLI: codegen Command" and "Publishing AOT" so the order tracks the workflow.
  • docs/codegen/cli.md — cross-link from the codegen write subsection.
  • docs/codegen/index.md — added to the "Next Steps" list.

Test plan

  • Markdown renders cleanly (no broken anchors, no orphan code-fence backticks).
  • All new internal links resolve to existing pages (./cli, ./aot).
  • Visual check on the docs site after merge — the new sidebar entry should appear between CLI and Publishing AOT.

🤖 Generated with Claude Code

…Ops page (closes #308)

Marten 9.0 removed runtime code generation entirely (marten#4461) and
marten#4498 stripped the `dotnet run -- codegen write` build-stage step
from Marten's DevOps Dockerfile guide. The guidance itself is still
broadly applicable to JasperFx-family deployments backed by runtime
codegen (Wolverine, custom hosts using the codegen engine directly) —
this PR moves it into the JasperFx docs site where it belongs.

New page: docs/codegen/docker.md

  - When to use this — table comparing Dynamic / Auto / Static / AOT
    postures so readers see where `codegen write` slots between the
    development default and the AOT publish endpoint.
  - The Dockerfile itself — multi-stage build-stage `codegen write` then
    `dotnet publish`, base images bumped from the recovered 8.0-alpine
    to 10.0-alpine (current .NET LTS as of 2026-05) with a note to bump
    again as future LTSes land.
  - Constraint paragraph for the build-stage host having to construct
    without external resources — covers the eager-Npgsql / factory /
    config-provider failure modes called out in the issue, with three
    documented workarounds (lazy access, args-guarded registration,
    push-into-IHostedService).
  - Marten-only callout — `codegen write` is a no-op for hosts that
    register only Marten 9.0, per the cleanup in marten#4461. Readers
    can drop the build-stage step in that shape.
  - See-also links to cli.md and aot.md.

Wired into:

  - docs/.vitepress/config.mts — new sidebar entry under Code Generation,
    between CLI and AOT, matching the workflow order.
  - docs/codegen/cli.md — cross-link from the `codegen write` section.
  - docs/codegen/index.md — added to Next Steps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit eeac8c5 into main May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: add Dockerfile / 'codegen write' guidance recovered from Marten DevOps page

1 participant