fix: pass --env-file so the generated .env is found with --project-directory - #5235
Open
tonnenpinguin wants to merge 1 commit into
Open
fix: pass --env-file so the generated .env is found with --project-directory#5235tonnenpinguin wants to merge 1 commit into
tonnenpinguin wants to merge 1 commit into
Conversation
The .env from the Environment tab is written next to the compose file (getCreateEnvFileCommand), but --project-directory (added in 87b9149) makes docker compose look for .env in the project directory instead. For nested compose paths every ${VAR} silently interpolates to a blank string. Point compose at the generated file explicitly. Related: Dokploy#5230
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this PR about?
Since 87b9149, compose deploys run with
--project-directory <code>, so docker compose looks for.envin the code root — butgetCreateEnvFileCommandwrites the Environment-tab.envnext to the compose file. For nested compose paths (e.g../docker/docker-compose.yml) every${VAR}silently interpolates to a blank string:Fix:
createCommandpasses--env-file <dirname(composePath)>/.env(only when Create Environment File is enabled; docker-compose type only — stack already uses env export).Checklist
canarybranch.Tested via:
compose-project-directory.test.ts(nested path, disabled flag, raw, stack); full compose suite passes except the pre-existing docker-dependentenv-file-literalsintegration testpnpm dokploy:dev, v0.30.3 canary): custom-git compose app withcomposePath: ./docker/docker-compose.yml, Environment-tab var, Create Environment File onThe "TESTVAR" variable is not set. Defaulting to a blank string., container env empty--env-file docker/.env, no warning, container receives the valueIssues related (if applicable)
Same root cause as #5230 (different symptom: that one is
build.context, this one is.envinterpolation). Hit in production upgrading v0.30.2 → v0.30.3.