fix(docker): Remove environment variable overrides in docker-compose.yml #1537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1411 - Docker Compose configuration was overriding
.llm.env
values with empty strings, causing LLM authentication failures.Root Cause: The
environment:
section indocker-compose.yml
used variable substitution syntax (${VAR:-}
) that checks the shell environment and.env
file (not.llm.env
) for values. When variables weren't found, Docker Compose substituted empty strings, which then overwrote the values from.llm.env
due to Docker Compose's precedence rules (environment:
has higher precedence thanenv_file:
).Solution: Commented out the
environment:
section to allow.llm.env
values to load directly into the container without being overwritten. This makes the Docker Compose behavior consistent withdocker run --env-file .llm.env
as documented.List of files changed and why
docker-compose.yml
- Commented out theenvironment:
section (lines 10-18) that was overriding.llm.env
values with empty strings. Added a warning comment explaining that uncommenting will cause.llm.env
to be overwritten.How Has This Been Tested?
Test Environment:
.llm.env
withGEMINI_API_KEY
andLLM_PROVIDER=gemini/gemini-2.5-flash
Test Steps:
Before fix (environment section uncommented):
After fix (environment section commented):
Checklist:
Note: Unit tests for Docker Compose configuration behavior would require Docker-in-Docker setup. The fix has been manually tested and verified to work as documented. The configuration change is a simplification (removal) rather than new code, making it inherently less error-prone.
References