fix(docker): persist the whole /work tree, not just mappings#182
Merged
Conversation
Mounting only /work/mappings — as the compose file and README suggested — silently loses environment configuration (/work/environments), response body files (/work/__files) and gRPC descriptors (/work/grpc) whenever the container is recreated, which is exactly what happens on every .NET Aspire app-host run. - docker-compose.yml: named volume at /work plus the ./mappings bind overlay, so stubs stay next to you and everything else survives too - README: named-volume example mounts /work; new .NET Aspire section with WithVolume + persistent lifetime - Dockerfile: entrypoint comment documents the full /work layout Verified against the published image: with a mappings-only mount the environment key is gone after recreate; with /work mounted (plain volume and the compose volume+bind shape) both the stub and the environment survive and serve. Fixes #181 Co-Authored-By: Claude Fable 5 <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
Fixes #181 — stubs and environment configuration were lost on container recreation (e.g. every .NET Aspire app-host run) because our own examples mounted only
/work/mappings, while the file store also keeps environment configuration under/work/environments(plus__files/andgrpc/)./work+ the./mappingsbind overlay: stubs stay in./mappingsnext to you, everything else survives recreation./work; explicit warning about mappings-only mounts; new .NET Aspire section (WithVolume("mockifyr-data", "/work")+ optional persistent lifetime), which is the exact scenario in the issue./worklayout.Verification (against the published
ghcr.io/omercelikdev/mockifyr:latest)docker rm+ recreate/work/mappingsonly (old advice)/work(new advice)/pingserves/work+ bind./mappingsoverlaydocker compose configvalidates clean.🤖 Generated with Claude Code