feat(miner-deployment): add docker-compose.miner.yml for AMS fleet mode#5299
Conversation
Add a compose file so operators run the miner as a long-lived worker instead of a hand-assembled docker run (JSONbored#5177): a `miner` service built from the package Dockerfile, `restart: unless-stopped`, SQLite state on a named `miner-data` volume, and credentials via an env file (.gittensory-miner.env) rather than inlined — so tokens stay out of the compose file and out of `docker inspect`. Documents `--scale miner=N` plus the honest caveat that a shared volume corrupts the SQLite ledgers, with the per-worker isolation patterns (separate compose projects or distinct config dirs; k8s StatefulSet for built-in isolation), in the compose comments and DEPLOYMENT.md. Ships a scanner-safe .env.example (empty values) and a validation test asserting the service contract + that no credential is hardcoded. Closes JSONbored#5177
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5299 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 474 474
Lines 40128 40128
Branches 14631 14631
=======================================
Hits 37869 37869
Misses 1583 1583
Partials 676 676
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 13:24:55 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Adds
packages/gittensory-miner/docker-compose.miner.ymlso operators run the miner as a long-lived worker instead of a hand-assembleddocker run(#5177). Built on the existing package Dockerfile.Fixes vs the prior submission (#5266, closed on review)
GITTENSORY_MINER_CONFIG_DIRfrom the composeenvironmentblock. Compose'senvironmentsilently overridesenv_file, so advertising that var as an env-file override was a dead footgun. The state dir is now simply fixed at/data/miner(the Dockerfile default + the volume mount) and documented as such — no contradiction. Removed the matching line from.env.example..gittensory-miner.envto.gitignore(keeping the committed.example), since the whole premise is that the filled-in file is never committed. Verified withgit check-ignore.Contents
docker-compose.miner.yml— aminerservice built from the Dockerfile (monorepo-root context),command: ["run"],restart: unless-stopped, SQLite state on a namedminer-datavolume, credentials viaenv_file(nothing overridable pinned inenvironment)..gittensory-miner.env.example— empty (scanner-safe) placeholders;.gitignoreprotects the real copy.DEPLOYMENT.md— Docker Compose section:upusage +--scalewith the honest SQLite-collision caveat and per-worker isolation patterns (separate compose projects / distinct config dirs; k8s StatefulSet for built-in isolation).Validation
test/unit/miner-docker-compose.test.ts(5 tests): service built from the package Dockerfile + named volume +unless-stopped; credentials via env-file with a regression assertion thatGITTENSORY_MINER_CONFIG_DIRis NOT pinned inenvironment(the closing defect); env example ships only empty placeholders; and.gitignoreprotects the real env file while keeping the example. The existingminer-deployment-doc.test.tsstill passes.tscclean; prettier-clean; no hardcoded credentials. Static packaging only — nosrc/**logic touched.Closes #5177