From 1c4e95d8e385bfe3859d79139fb5358e297c16dc Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Fri, 6 Feb 2026 00:16:02 -0600 Subject: [PATCH] refactor(settings): update dokploy image handling during service update - Removed the deprecated getDokployImage function and replaced it with dynamic image retrieval based on available updates. - The service update now checks for available updates and uses the latest version from the update data, enhancing deployment efficiency. --- apps/dokploy/server/api/routers/settings.ts | 25 +++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/apps/dokploy/server/api/routers/settings.ts b/apps/dokploy/server/api/routers/settings.ts index c9d21e515..04d5c1022 100644 --- a/apps/dokploy/server/api/routers/settings.ts +++ b/apps/dokploy/server/api/routers/settings.ts @@ -12,7 +12,6 @@ import { DEFAULT_UPDATE_DATA, execAsync, findServerById, - getDokployImage, getDokployImageTag, getLogCleanupStatus, getUpdateData, @@ -22,7 +21,6 @@ import { paths, prepareEnvironmentVariables, processLogs, - pullLatestRelease, readConfig, readConfigInPath, readDirectory, @@ -406,18 +404,17 @@ export const settingsRouter = createTRPCRouter({ return true; } - await pullLatestRelease(); - - // This causes restart of dokploy, thus it will not finish executing properly, so don't await it - // Status after restart is checked via frontend /api/health endpoint - void spawnAsync("docker", [ - "service", - "update", - "--force", - "--image", - getDokployImage(), - "dokploy", - ]); + const data = await getUpdateData(packageInfo.version); + if (data.updateAvailable) { + void spawnAsync("docker", [ + "service", + "update", + "--force", + "--image", + `dokploy/dokploy:${data.latestVersion}`, + "dokploy", + ]); + } return true; }),