mem0
mem0 copied to clipboard
fix: Add missing env_file to UI service in docker-compose
Description
This PR fixes inconsistent environment variable handling in docker-compose.yml that breaks documented workflows.
Current Issues:
- UI
.envfile ignored - README instructs users to createui/.env, but docker-compose doesn't load it (only works via Makefile) - Confusing API_KEY variable - Listed in docker-compose and config.json but unused (codebase expects
OPENAI_API_KEY)
What This Fixes:
- Adds
env_file: - ui/.envto UI service → Makes documented workflow (cp ui/.env.example ui/.env) actually work - Removes unused
API_KEYenv variable from API service → Reduces confusion - Standardizes
config.jsonto useenv:OPENAI_API_KEY→ Aligns with codebase expectations - Documents Makefile precedence behavior → Users understand when
.envvalues are overridden
Environment Variable Precedence (after fix):
- Makefile env vars > .env file > empty
- Both
make upanddocker compose upnow work correctly
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
- [ ] Documentation update
How Has This Been Tested?
Manual testing with both workflows:
-
make up- Still works (Makefile variables take precedence) -
docker compose up- Now works withui/.envfallback (previously broken) -
[ ] Unit Test
-
[x] Manual Testing (verified both Makefile and direct docker-compose workflows)
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas (N/A - YAML config changes)
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works (N/A - infrastructure config)
- [ ] New and existing unit tests pass locally with my changes (N/A - no test changes)
- [ ] Any dependent changes have been merged and published in downstream modules
- [x] I have checked my code and corrected any misspellings
@parshvadaftari I rebased again on main, ready to merge? :slightly_smiling_face: