feat(compose): NATS-backed micro.mu example services in Docker - #4883
Draft
alex-dna-tech wants to merge 6 commits into
Draft
feat(compose): NATS-backed micro.mu example services in Docker#4883alex-dna-tech wants to merge 6 commits into
alex-dna-tech wants to merge 6 commits into
Conversation
…ockerfile - relocate docker-compose.yml to internal/docker/, fix volume mount paths - add root micro.mu defining example services for micro run - add examples container running micro run --address :8081 against repo - build go-micro image from internal/docker/Dockerfile: compiles micro CLI and protoc-gen-micro from source, installs git/make/curl/protoc; repo root supplied as additional build context so paths stay relative to the compose file - combine gw and mcp into one gw container: gateway --mcp-address :3000, ports 8080+3000 - llama: entrypoint starts server only if MiniCPM5-1B-Q4_K_M.gguf exists, otherwise downloads it from Hugging Face into the models folder; -n 1024 context - gitignore runtime data; .dockerignore keeps build context lean
Container gateway (docker-compose) exposed :8080 with auth on, but the browser dashboard login only accepts a stored user/password account and the generated machine token is not accepted there — dead end, no way in. Restore the documented admin/micro default for the compose image without reintroducing a hardcoded credential: the gateway creates the admin account only when the operator sets MICRO_ADMIN_PASSWORD (user defaults to admin, overridable via MICRO_ADMIN_USER). Respects an existing account and the auth/.admin-deleted marker. The compose file opts in with the documented admin/micro.
The examples container (micro run --address :8081) binds an exposed address so auth is on, but without MICRO_ADMIN_PASSWORD no admin account exists and the documented admin/micro login fails with 'Invalid credentials'. Set the same credentials as the gw container.
- add nats:latest service, point gw and examples at nats://nats:4222 - gateway: create logs/pid dirs so /logs and /status don't 500
cmd.Init isolated the registry in a local copy, but the gateway and CLI registry command read registry.DefaultRegistry directly, so they never saw the registry selected via flags/env. Sync it back after configure so CLI list/get/watch, gateway and MCP discovery all query the same registry.
Run services from micro.mu in their own container (no gateway, no HTTP listener); gw owns dashboard/API/MCP and proxies via NATS. Drop stale go.mod/go.sum from hello-world and web-service so they build inside the root v6 module. Add buildkit cache mounts and a warm Go module cache so micro run rebuilds services offline and fast.
alex-dna-tech
marked this pull request as draft
August 10, 2026 18:11
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.
Runs micro.mu example services in a dedicated micro-run container against a shared NATS registry/broker; gw container owns the dashboard/API/MCP gateway. Includes a fix syncing the configured registry back to registry.DefaultRegistry so cross-process discovery works.
What
Runs the micro.mu example services in a dedicated
micro-runcontainer against a shared NATS registry/broker, with thegwcontainer owning the dashboard/API/MCP gateway. Verified end-to-end: services register on NATS,micro registry list/getworks, MCP gateway discovers 19 tools across 5 services, and RPC calls route through the gateway.Commits
Key fix
cmd.Initisolated the configured registry in a local copy while the gateway and CLIregistrycommand readregistry.DefaultRegistrydirectly — so cross-process discovery silently returned nothing. Now the configured registry is synced back to the package global after configure (cmd/cmd.go).Verification
micro registry listin micro-run: 5 services (users, web.service, orders, contacts, greeter)greeter.Greeter.Hello→{"message":"Hello from-gateway"}