You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Dockerfile volume mount path mismatch with config.json #173
The Dockerfile creates a volume mount at /app/data but the Basic Memory config.json is configured to look for data in /root/basic-memory, causing a path mismatch that prevents the application from finding its data directory.
Steps To Reproduce
Build the Docker image from the current Dockerfile
Run the container with a volume mount: docker run -v mydata:/app/data basic-memory
Basic Memory will look for data in /root/basic-memory instead of /app/data
Application fails to access persisted data
Expected Behavior
Basic Memory should use the /app/data directory that is defined as a VOLUME in the Dockerfile.
Actual Behavior
Basic Memory looks for data in /root/basic-memory, ignoring the Docker volume mount at /app/data.
Environment
Docker version: Various
Basic Memory version: Latest
Installation method: Docker
Additional Context
The Dockerfile contains:
VOLUME ["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/app/data"]
But the config.json uses:
{
"default_project_path": "/root/basic-memory"
}
Possible Solution
Either:
Update the Dockerfile to set VOLUME to /root/basic-memory
Update the config.json to use /app/data as the default_project_path
Add an environment variable override for the data path in Docker contexts
Activity
groksrc commentedon Jun 25, 2025
@claude take a look at this one and see if you can find the problem and fix it.
claude commentedon Jun 25, 2025
Claude finished @groksrc's task —— View job •
claude/issue-173-20250625_194717• Create PR ➔Task Completed ✅
Analysis
Found the root cause of the issue:
ENV BASIC_MEMORY_HOME=/app/data(line 21)Path.home() / "basic-memory"which resolves to/root/basic-memoryin the container (config.py:48)BASIC_MEMORY_HOMEenvironment variableSolution Implemented
Updated the configuration system in
src/basic_memory/config.pyto:BASIC_MEMORY_HOMEenvironment variable when creating the default "main" project pathPath.home() / "basic-memory"if the environment variable is not setprojectsfield default and themodel_post_initmethodNow the container will correctly use
/app/dataas the default project path whenBASIC_MEMORY_HOME=/app/datais set.Changes Made
BasicMemoryConfig.projectsdefault factory to useos.getenv("BASIC_MEMORY_HOME", Path.home() / "basic-memory")model_post_initmethod to use the same logic for consistencyfix: respect BASIC_MEMORY_HOME environment variable in Docker containers
fix: Improve project management validation and idempotency
fix: Improve project management validation and idempotency