fix: ensure Compose Traefik domain labels are written to local daemons #3030
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?
I recently upgraded the Docker daemon of a server running Dokploy to version v29. This update broke Dokploy's Traefik v3.5.0 integration due to stricter Docker daemon API version requirements. Luckily, this issue was fixed in PR #3000, which prompted me to update Dokploy to the latest canary build to get proper support for Traefik v3.6.1.
However, after I attempted to re-deploy Docker Compose projects with the newer Dokploy build, the services no longer had any associated domain routers in Traefik's dashboard and were therefore externally unreachable.
A quick
docker inspecton the affected containers showed that they lacked any Traefik labels, which Dokploy should have attached, despite the "Preview Compose" button displaying the expected extra labels. Increasing Traefik's logging verbosity further confirmed that these containers were being treated as disabled.To investigate why Dokploy had stopped applying these labels, I remote-debugged my production Dokploy container by modifying its entrypoint to
node --inspect=0.0.0.0 -r dotenv/config dist/server.mjsand attaching a debugger. Stepping through the deployment logic revealed that thewriteDomainsToComposeRemotefunction was refusing to write the modified Docker Compose file to disk for local Dokploy deployments (i.e., whenserverIdisnull). As a result, the domain configuration labels were never applied, because the unmodified raw Docker Compose file was used instead.After bypassing this remote server check, Traefik integration for these deployments began working again, and I have not observed any regressions so far.
Therefore, this PR includes the necessary change to resolve the regression, which I strongly suspect was introduced by #2978, as the issue only began occurring after I updated Dokploy.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
Tackles a root cause of #2682 in the latest canary builds, but it may not fix other root causes of that issue.