fix: add createEnvFile toggle to Compose, mirroring Application - #5008
Merged
Conversation
Comment on lines
+22
to
+24
| const envCommand = compose.createEnvFile | ||
| ? getCreateEnvFileCommand(compose) | ||
| : ""; |
Contributor
There was a problem hiding this comment.
Stale generated env survives rebuilds
When a non-raw Compose project is deployed with createEnvFile enabled and the setting is later disabled, rebuildCompose reuses the checkout while this branch neither rewrites nor removes the generated .env. Docker Compose then reads the stale file and deploys with obsolete project and environment values despite the toggle being disabled.
Knowledge Base Used: Compose Deployment Flow
narcisonunez
force-pushed
the
fix/compose-create-env-file-toggle
branch
from
August 7, 2026 21:52
965d5f0 to
be71866
Compare
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?
Compose always overwrote .env on every deploy, even when a repo already committed its own. Add the same createEnvFile switch Application has (default true) so users can opt out and Dokploy leaves the file alone.
Adds the same
createEnvFiletoggle Application already has (defaulttrue, same UI copy/pattern). When disabled, Dokploy never touches.env, so a repo-tracked file survives untouched.Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #4956
Screenshots (if applicable)
Greptile Summary
The PR adds a persisted
createEnvFilesetting for Compose projects and exposes it through the environment editor and deployment builder.true..envduring Compose deployment when the setting is disabled.Confidence Score: 4/5
The PR is not yet safe to merge because disabling
createEnvFileduring a git-based rebuild can leave Docker Compose consuming a stale generated.env.The builder only stops writing
.env; it does not remove an existing generated file, while non-raw rebuilds reuse the checkout and invoke Docker Compose from that directory.Files Needing Attention: packages/server/src/utils/builders/compose.ts
Reviews (2): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile
Context used: