mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

fix: Add missing env_file to UI service in docker-compose

Open frederikb96 opened this issue 1 month ago • 1 comments

Description

This PR fixes inconsistent environment variable handling in docker-compose.yml that breaks documented workflows.

Current Issues:

  1. UI .env file ignored - README instructs users to create ui/.env, but docker-compose doesn't load it (only works via Makefile)
  2. 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/.env to UI service → Makes documented workflow (cp ui/.env.example ui/.env) actually work
  • Removes unused API_KEY env variable from API service → Reduces confusion
  • Standardizes config.json to use env:OPENAI_API_KEY → Aligns with codebase expectations
  • Documents Makefile precedence behavior → Users understand when .env values are overridden

Environment Variable Precedence (after fix):

  • Makefile env vars > .env file > empty
  • Both make up and docker compose up now 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 with ui/.env fallback (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

frederikb96 avatar Oct 16 '25 20:10 frederikb96

@parshvadaftari I rebased again on main, ready to merge? :slightly_smiling_face:

frederikb96 avatar Oct 31 '25 08:10 frederikb96