From 1c4e95d8e385bfe3859d79139fb5358e297c16dc Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Fri, 6 Feb 2026 00:16:02 -0600 Subject: [PATCH 1/3] 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; }), From 83599cee372d32ce4daeed7536bcffaa1b67f425 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 06:18:48 +0000 Subject: [PATCH 2/3] [autofix.ci] apply automated fixes --- .../cluster/swarm-forms/network-form.tsx | 139 +++++++++--------- 1 file changed, 69 insertions(+), 70 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/network-form.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/network-form.tsx index 43a816dfc..f2c640cfe 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/network-form.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/network-form.tsx @@ -104,10 +104,9 @@ export const NetworkForm = ({ id, type }: NetworkFormProps) => { formData.networks ?.filter((network) => network.Target) .map((network) => { - const entries = - (network.DriverOptsEntries ?? []).filter( - (e) => e.key.trim() !== "", - ); + const entries = (network.DriverOptsEntries ?? []).filter( + (e) => e.key.trim() !== "", + ); const driverOpts = entries.length > 0 ? Object.fromEntries( @@ -194,74 +193,74 @@ export const NetworkForm = ({ id, type }: NetworkFormProps) => {
Driver options (optional) - e.g. com.docker.network.driver.mtu, com.docker.network.driver.host_binding + e.g. com.docker.network.driver.mtu, + com.docker.network.driver.host_binding - {(form.watch(`networks.${index}.DriverOptsEntries`) ?? []).map( - (_, optIndex) => ( -
- ( - - - - - - - )} - /> - ( - - - - - - - )} - /> - -
- ), - )} + ) ?? []; + form.setValue( + `networks.${index}.DriverOptsEntries`, + entries.filter((_, i) => i !== optIndex), + ); + }} + > + Remove + +
+ ))} From 5381b1381367545d8f7f7f4246bab1815cefb1c8 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Fri, 6 Feb 2026 21:40:53 -0600 Subject: [PATCH 3/3] refactor(settings): remove deprecated Docker image functions - Eliminated the getDokployImage and pullLatestRelease functions to streamline the settings service. - Updated the code to focus on dynamic image retrieval, enhancing clarity and maintainability. --- packages/server/src/services/settings.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/server/src/services/settings.ts b/packages/server/src/services/settings.ts index 4235376d9..0ce252308 100644 --- a/packages/server/src/services/settings.ts +++ b/packages/server/src/services/settings.ts @@ -1,6 +1,5 @@ import { readdirSync } from "node:fs"; import { join } from "node:path"; -import { docker } from "@dokploy/server/constants"; import { execAsync, execAsyncRemote, @@ -26,19 +25,6 @@ export const getDokployImageTag = () => { return process.env.RELEASE_TAG || "latest"; }; -export const getDokployImage = () => { - return `dokploy/dokploy:${getDokployImageTag()}`; -}; - -export const pullLatestRelease = async () => { - const stream = await docker.pull(getDokployImage()); - await new Promise((resolve, reject) => { - docker.modem.followProgress(stream, (err, res) => - err ? reject(err) : resolve(res), - ); - }); -}; - /** Returns Dokploy docker service image digest */ export const getServiceImageDigest = async () => { const { stdout } = await execAsync(