docs(codegen): recover Marten DevOps Dockerfile + 'codegen write' guidance (#2846)#2847
Merged
Merged
Conversation
Marten 9.0 removed its runtime codegen pipeline entirely (marten#4461) and the Marten 9.0 docs cleanup (marten#4498) stripped the `dotnet run -- codegen write` Dockerfile section from Marten's DevOps page. That guidance no longer applies to Marten but is squarely applicable to Wolverine — Wolverine still ships runtime codegen and the same multi-stage build pattern (pre-generate adapters into `Internal/Generated/`, ship static C# in the production image) gives Wolverine apps a Roslyn-free cold start. Replaces the placeholder section in docs/guide/codegen.md (which previously linked to the now-removed Marten page) with: * CLI wire-up note (`return await app.RunJasperFxCommands(args);`) * Full multi-stage Dockerfile, base images bumped to `9.0-alpine` to match Wolverine 6.0's minimum TFM * `codegen write` constraint paragraph — the build-stage run can't reach external resources, with two mitigation patterns * Cross-link to the AOT publishing guide for the trim/AOT follow-on 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
Closes #2846.
Marten 9.0 removed its runtime code-generation pipeline entirely, and the Marten 9.0 docs cleanup (marten#4498) followed up by stripping the
dotnet run -- codegen writeDockerfile section from Marten's DevOps page. That guidance no longer applies to Marten, but Wolverine still ships its own runtime codegen, so the multi-stage build pattern (pre-generate handler/endpoint adapters intoInternal/Generated/, ship static C# in the production image) is directly applicable to Wolverine apps.Replaces the placeholder "Embedding Codegen in Docker" section in
docs/guide/codegen.md(which previously pointed at the now-removed Marten page) with the recovered guidance adapted for Wolverine.What the new section covers
return await app.RunJasperFxCommands(args);is the last-line requirement to makedotnet run -- codegen writereachable.mcr.microsoft.com/dotnet/sdk:9.0-alpine/aspnet:9.0-alpineto match Wolverine 6.0's minimum TFM. Includes the non-root user +EXPOSE 5000hygiene the Marten original had.codegen writestep has no runtime resources." Explains why eager DB/broker connections inProgram.csbreak the build-stage step, with two mitigations: defer to hosted services / DI factories, or use theCodeGeneration.IsRunningGeneration()short-circuit pattern that already lives further down the same page (cross-linked).docs/guide/aot.mdfor the trim/AOT follow-on once aStatic-mode image is in place.Doc home
Picked option #2 from the issue ("new section inside existing
docs/guide/codegen.md") because:## Embedding Codegen in DockerH2 anchor was already cross-referenced from theWolverineFx.RuntimeCompilationsection earlier in the page (see [Embedding Codegen in Docker](#embedding-codegen-in-docker) below). Replacing the section in place keeps that link working.Test plan
git diffclean — pure content swap inside the existing## Embedding Codegen in Dockersection.#embedding-codegen-in-docker).🤖 Generated with Claude Code