Merge pull request #3608 from Dokploy/3532-dokploy-is-not-updating

refactor(settings): update dokploy image handling during service update
This commit is contained in:
Mauricio Siu
2026-02-06 21:43:22 -06:00
committed by GitHub
2 changed files with 11 additions and 28 deletions

View File

@@ -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;
}),

View File

@@ -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(