Repository navigation
fix(compose): start with the custom command so its extra compose files are kept - #5807
Open
moataz-hjaiji wants to merge 1 commit into
Open
moataz-hjaiji wants to merge 1 commit into
moataz-hjaiji wants to merge 1 commit into
Conversation
…s are kept Start ran a fixed `docker compose -f <composePath> up -d`, ignoring the custom command that deploy uses. With a command that adds an override file, Stop then Start recreated the containers without the override. Closes Dokploy#5799
This branch has not been deployed
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?
Start on a Compose service ran a fixed
docker compose -p <app> -f <composePath> up -dand ignored the service's custom Command, which Deploy and Redeploy use throughcreateCommand. With a custom command that adds an override file (the workaround from #1727 for multiple compose files), Stop then Start recreated the containers without the override, losing its networks, aliases, ports, labels and environment.startComposenow usescreateCommand(compose)when a custom command is set, so Start brings the service back with the same compose files as the last deploy. The command goes through the same sanitizing as on deploy, so shell control characters are still rejected. Without a custom command, Start runs exactly as before.Note: Start now runs the custom command as written. If it contains build flags (
--build,--pull always), Start will apply them too, the same as a deploy.Checklist
Before submitting this PR, please make sure that:
canarybranch.Tested with unit tests, not yet on a running instance:
__test__/compose/compose-start-command.test.ts(3 cases): no custom command keeps the old Start command; a custom command with an override file is used as-is; a command with shell control characters is rejected and nothing runs. The two new cases fail without the fix.pnpm typecheckandbiome checkon the changed files pass.vitestrun: the same pre-existing failures as oncanaryin my environment (nativebcryptbinding, Docker swarm, real git/build tests), plus the 3 new passing tests.Issues related (if applicable)
closes #5799


Confidence Score: 5/5
The PR appears safe to merge.Summary
Start now uses the configured custom command through
createCommand, keeping extra Compose files.Reviews (1) · Last reviewed commit: "fix(compose): start with the custom comm..." · Reviewed by Greptile