Skip to content

fix(docker): persist the whole /work tree, not just mappings#182

Merged
omercelikdev merged 1 commit into
mainfrom
fix/issue-181-persist-work-volume
Jul 26, 2026
Merged

fix(docker): persist the whole /work tree, not just mappings#182
omercelikdev merged 1 commit into
mainfrom
fix/issue-181-persist-work-volume

Conversation

@omercelikdev

Copy link
Copy Markdown
Owner

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/ and grpc/).

  • docker-compose.yml — named volume at /work + the ./mappings bind overlay: stubs stay in ./mappings next to you, everything else survives recreation.
  • README — named-volume example now mounts /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.
  • Dockerfile — entrypoint comment documents the full /work layout.

Verification (against the published ghcr.io/omercelikdev/mockifyr:latest)

Scenario After docker rm + recreate
Volume at /work/mappings only (old advice) stub survives, environment key gone — issue reproduced
Volume at /work (new advice) stub + environment survive, /ping serves
Compose shape: volume /work + bind ./mappings overlay stub survives and is visible on host, environment survives

docker compose config validates clean.

🤖 Generated with Claude Code

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>
@omercelikdev
omercelikdev merged commit 594a540 into main Jul 26, 2026
3 checks passed
@omercelikdev
omercelikdev deleted the fix/issue-181-persist-work-volume branch July 26, 2026 00:36
@omercelikdev omercelikdev mentioned this pull request Jul 26, 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.

Mockifyr stub reset

1 participant