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.
This commit is contained in:
Mauricio Siu
2026-02-06 00:16:02 -06:00
parent 97f1105cf4
commit 1c4e95d8e3
+11 -14
View File
@@ -12,7 +12,6 @@ import {
DEFAULT_UPDATE_DATA, DEFAULT_UPDATE_DATA,
execAsync, execAsync,
findServerById, findServerById,
getDokployImage,
getDokployImageTag, getDokployImageTag,
getLogCleanupStatus, getLogCleanupStatus,
getUpdateData, getUpdateData,
@@ -22,7 +21,6 @@ import {
paths, paths,
prepareEnvironmentVariables, prepareEnvironmentVariables,
processLogs, processLogs,
pullLatestRelease,
readConfig, readConfig,
readConfigInPath, readConfigInPath,
readDirectory, readDirectory,
@@ -406,18 +404,17 @@ export const settingsRouter = createTRPCRouter({
return true; return true;
} }
await pullLatestRelease(); const data = await getUpdateData(packageInfo.version);
if (data.updateAvailable) {
// This causes restart of dokploy, thus it will not finish executing properly, so don't await it void spawnAsync("docker", [
// Status after restart is checked via frontend /api/health endpoint "service",
void spawnAsync("docker", [ "update",
"service", "--force",
"update", "--image",
"--force", `dokploy/dokploy:${data.latestVersion}`,
"--image", "dokploy",
getDokployImage(), ]);
"dokploy", }
]);
return true; return true;
}), }),