fix: bump dokploy-traefik to pinned version on update (#4324)#4603
Open
apotema wants to merge 1 commit into
Open
fix: bump dokploy-traefik to pinned version on update (#4324)#4603apotema wants to merge 1 commit into
apotema wants to merge 1 commit into
Conversation
Docker Compose domains route via Traefik's docker/swarm provider (container labels), not the file provider — so no dynamic config file is expected for compose. Traefik releases older than the pinned version are incompatible with Docker Engine 28+: their docker/swarm provider stops discovering containers, so label-based routing silently 404s while file-provider apps keep working. New installs already pin the current Traefik version, but existing installs never get the bump on upgrade (reloadTraefik only restarts; the self-update only touches the dokploy image). So any pre-existing install silently breaks once the host's Docker auto-updates to 28+. Add ensureTraefikUpToDate(): reads the running dokploy-traefik image tag and, if below the pinned TRAEFIK_VERSION, recreates it via the existing writeTraefikSetup path (env/ports preserved; handles both Swarm service and standalone). No-op when already current. Invoked from the updateServer mutation, awaited before the dokploy service update restarts the container. Verified: tsc clean on @dokploy/server and apps/dokploy; version-gate logic checked against realistic image tags (v3.1.2/v3.6.6 bump, v3.6.7+/digest no-op).
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.
Problem
Fixes #4324. Docker Compose apps with configured domains return 404 on Docker Engine 28+, even though containers are healthy and Dokploy correctly injects the Traefik labels.
The popular "no dynamic config file is generated" diagnosis in the thread is a misdiagnosis: Compose domains route via Traefik's docker/swarm provider (container labels — see
utils/docker/domain.ts), not the file provider. No.ymlfile in/etc/dokploy/traefik/dynamic/is expected for Compose. Applications use the file provider, which is why only Compose breaks.The real cause (confirmed by multiple reporters): Traefik releases older than the pinned version are incompatible with Docker Engine 28+ — the docker/swarm provider stops discovering containers, so label-based routing silently yields no routes. Both reported workarounds corroborate it: downgrade Docker to 27, or bump Traefik to v3.6.7.
Why existing installs are stuck
The repo already pins
TRAEFIK_VERSION = "3.6.7"(traefik-setup.ts:23), so new installs are fine. But on existing installs nothing ever bumps the Traefik image:reloadTraefik→docker service update --force dokploy-traefik(restart only, same image)initialize*Traefik, which run at install time (setup.ts) — not on upgrade or restartNote: setting the
TRAEFIK_VERSIONenv var does not fix an existing install on its own — nothing recreates the runningdokploy-traefikcontainer on a dokploy restart, and the default is already correct. The missing piece is a recreate-trigger.Fix
Add
ensureTraefikUpToDate()(services/settings.ts): read the runningdokploy-traefikimage tag and, if below the pinnedTRAEFIK_VERSION, recreate it via the existingwriteTraefikSetuppath (env/ports preserved; handles both Swarm service and standalone). It is a no-op when Traefik is already at or above the configured version, and it never downgrades.It compares against the same
TRAEFIK_VERSIONconstant used everywhere else, so it respects a user-configured version (treats it as a floor, not a hard-coded 3.6.7).Invoked from the
updateServermutation, awaited before the dokploy service update restarts the container, so existing installs auto-heal on their next Dokploy update.Verification
tsc --noEmitclean on both@dokploy/serverandapps/dokploy(run in anode:24.4.0-slimbuild with the real workspace).v3.1.2/v3.6.6→ bump;v3.6.7,v3.6.7@sha256:…,v3.7.0→ no-op; unparseable/latest→ safe no-op.biome checkclean.Scope / notes
dokploy-traefik; remote-server Traefik bumping is out of scope here.