Conversation
Show the relative path to reference a File Mount from docker-compose.yml (e.g. ../files/Caddyfile) in the add and update volume dialogs for compose services. The path accounts for the pinned --project-directory used by docker compose and for the compose file location when deploying as a stack. Closes Dokploy#5147
…e example source startCompose ran docker compose without the --project-directory/--env-file flags used on deploy, so relative mounts in a nested compose file resolved against a different base after a start. Share the flag builder between both commands. Render the file mount example with long volume syntax and a quoted source so file names containing ':' or ' #' produce valid compose YAML.
Author
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.
Show the relative path to reference a File Mount from docker-compose.yml (e.g. ../files/Caddyfile) in the add and update volume dialogs for compose services. The path accounts for the pinned --project-directory used by docker compose and for the compose file location when deploying as a stack.
What is this PR about?
When creating a File Mount for a Compose service, the file is stored in the service's
filesdirectory, outside the cloned repository, but the UI never tells you how to reference it fromdocker-compose.yml. This PR adds a small hint in the Add and Update volume dialogs (Compose services only) showing the relative path and an example volume entry, updated live as you type the file name:../files/Caddyfile
volumes:
The path is computed by
getComposeFileMountSource(apps/dokploy/lib/compose-file-mount.ts):docker composewith--project-directorypinned to thecodedir, so the path is always../files/<name>, even ifcomposePathis nested (e.g../deploy/docker-compose.yml).docker stack deployhas no psolves relative paths from the compose file'sfolder, so a nested
composePathadds extrploy/prod/docker-compose.yml→../../../files/`). Raw stacks use thUnit tests cover both compose types, nestedand file names with leading
./or/.Also aligns startCompose with deploy so relative mounts resolve against the same base (--project-directory) when the compose has mounts.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related
closes #5147
Screenshots
The PR should not merge until nested Docker Compose file mounts resolve consistently during both deployment and subsequent start operations.
Summary
This PR adds a Compose file-mount path helper, displays its result in add and update volume dialogs, and adds focused unit coverage.
Reviews (1) · Last reviewed commit: "feat(compose): show usage path for file ..."