Repository navigation
fix: pull the new image before restarting Dokploy on update - #35
Merged
Merged
Conversation
The dokploy service updates stop-first, so the swarm task pulled the new 4.4 GB image only after the old container had stopped. On dev that left the panel down for 2 min 12 s (old container stopped 11:31:42, new one started 11:33:54) and Traefik answered Bad Gateway. Both update commands (AgentHits and official) now run `docker pull` first and stop if it fails, so the downtime is only the restart. The official update moves into getOfficialUpdateCommand to be testable. The update dialog used to reload after a fixed 8 s once /api/health answered. With the pull in front, the old server still answers then, so the dialog now waits until the server has gone down once and is healthy again (giving up after 20 minutes with an error). The image list and the cleanup also missed images that swarm pulls by digest: they have no tag, and `docker image ls` hides untagged images unless `-a` is passed. The running image after a UI update was one of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The
dokployservice updates stop-first, so the swarm task pulled the new 4.4 GB image only after the old container had stopped. On dev the panel was down for 2 min 12 s (old container finished 11:31:42 UTC, new one started 11:33:54 UTC) and Traefik answered Bad Gateway the whole time.Fix
getAgentHitsUpdateCommandand the newgetOfficialUpdateCommandstart withdocker pull <image> || exit 1, while the old container still serves the panel. The swarm task then finds the image locally, so the downtime is just the restart (~15–20 s). If the pull fails, the service is not touched./api/healthanswered. With the pull in front, the old server still answers at that point, so the dialog would have reloaded into the old version. It now waits until the server has gone down once and is healthy again (requests time out after 5 s, gives up after 20 min with an error). Texts say the panel stays usable during the download.docker image lshides them unless-ais passed. The running image after a UI update was one of them, so the image list (feat: optionally remove old Dokploy images on web server update #34) didn't show it and the cleanup would never remove such images. Both now usedocker image ls -a.Checks
vitest __test__/settings/ __test__/security/: 253 passed (new: pull runs beforedocker service updatein both commands, keep-count env on the official path,-ain listing and cleanup).tsc --noEmitinapps/dokploy; biome clean;sh -non the generated update and cleanup scripts.docker events, and that the running digest-only image shows only with-a.🤖 Generated with Claude Code