Skip to content

fix(docker): add --home CLI flag and Docker deployment docs#1521

Open
SonicBotMan wants to merge 1 commit intoMemTensor:mainfrom
SonicBotMan:fix/docker-config-discovery
Open

fix(docker): add --home CLI flag and Docker deployment docs#1521
SonicBotMan wants to merge 1 commit intoMemTensor:mainfrom
SonicBotMan:fix/docker-config-discovery

Conversation

@SonicBotMan
Copy link
Copy Markdown

Summary

Fixes #1520

When MemTensor runs inside a Docker container and the daemon is started directly from the container's entrypoint.sh (not through the Python adapter's bridge_client.py), the bridge cannot locate its config.yaml, resulting in missing embedding/LLM providers and wrong data directory.

Changes

1. bridge.cts--home CLI flag

Adds a --home=<path> CLI argument that sets MEMOS_HOME before the config is loaded via resolveHome(). This is the simplest way to configure the bridge in Docker:

node --experimental-strip-types bridge.cts --agent=hermes --daemon --home=/opt/data/home/.hermes/memos-plugin

Also updated the file's header comment to document all CLI flags and env vars.

2. docs/DOCKER.md — Docker Deployment Guide

New document covering:

  • The config discovery problem and symptoms
  • Three solutions (--home flag, MEMOS_HOME env var, MEMOS_CONFIG_FILE env var)
  • Config resolution priority table
  • Minimal working config example
  • Verification steps
  • Common pitfalls troubleshooting table

3. README.md — Configuration Discovery section

Added a "Configuration Discovery" section documenting the 4-level priority for config resolution, with a link to the Docker guide.

4. adapters/hermes/README.md — Docker startup example

Added a "Docker / Manual Daemon Startup" subsection showing the --home flag usage.

Testing

  • bridge.cts changes are additive (new CLI arg + env var injection before bootstrap)
  • No behavior change for existing deployments where MEMOS_HOME is already set or the default path works
  • The --home flag resolves to an absolute path before being passed to process.env, consistent with resolveHome() behavior

How Docker users should use this

Before (broken — daemon can't find config):

# In entrypoint.sh:
node bridge.cts --daemon --port 18992 --viewer-port 18901
# → Embedding: disabled, LLM: disabled, DB: empty path

After (working):

# In entrypoint.sh:
node bridge.cts --daemon --agent=hermes --home=/opt/data/home/.hermes/memos-plugin
# → Reads config.yaml with embedding + LLM + branding

When MemTensor runs inside a Docker container and the daemon is started
directly from the container's entrypoint.sh (not through the Python
adapter's bridge_client.py), the bridge cannot locate its config.yaml.

This adds:
- --home=<path> CLI flag to bridge.cts that sets MEMOS_HOME before
  bootstrap, making Docker entrypoint configuration straightforward
- docs/DOCKER.md with full Docker deployment guide, troubleshooting,
  and config discovery explanation
- Configuration Discovery section in README.md documenting the priority
  order (CLI flag > env var > default)
- Docker startup example in adapters/hermes/README.md

Fixes MemTensor#1520
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.

Docker deployment: daemon loses embedding/LLM config when started outside Python adapter

2 participants