Add Dockerfile / codegen-write guidance recovered from Marten's pre-9.0 DevOps page (closes #308)#309
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docs-only. Marten 9.0 (marten#4461) removed runtime codegen entirely, and the cleanup PR marten#4498 stripped the
dotnet run -- codegen writeDockerfile 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.mdcodegen writebetweenDynamic(development),Auto(staging),Static(production cold-start sensitivity), and full AOT (no Roslyn at runtime).dotnet run -- codegen writeinside the build stage so the published artifacts ship pre-generated. Base images bumped from the recovered8.0-alpineto10.0-alpine(current .NET LTS as of 2026-05), with a note to bump as future LTSes land.dotnet run -- codegen writebuilds the DI container. Documents the three usual failure modes (eagerAddNpgsqlDataSource, eager singleton factories, eager config providers) and three workarounds (lazy access, args-guarded registration, push-into-IHostedService).codegen writeis a no-op for hosts that register only Marten 9.0, so the build-stage line can simply be dropped in that shape.cli.mdandaot.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 thecodegen writesubsection.docs/codegen/index.md— added to the "Next Steps" list.Test plan
./cli,./aot).🤖 Generated with Claude Code