mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix(settings): prevent to download the latest image on reload
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
|||||||
} from "@/server/utils/docker/utils";
|
} from "@/server/utils/docker/utils";
|
||||||
import { recreateDirectory } from "@/server/utils/filesystem/directory";
|
import { recreateDirectory } from "@/server/utils/filesystem/directory";
|
||||||
import { sendDockerCleanupNotifications } from "@/server/utils/notifications/docker-cleanup";
|
import { sendDockerCleanupNotifications } from "@/server/utils/notifications/docker-cleanup";
|
||||||
|
import { execAsync } from "@/server/utils/process/execAsync";
|
||||||
import { spawnAsync } from "@/server/utils/process/spawnAsync";
|
import { spawnAsync } from "@/server/utils/process/spawnAsync";
|
||||||
import {
|
import {
|
||||||
readConfig,
|
readConfig,
|
||||||
@@ -49,14 +50,10 @@ import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc";
|
|||||||
|
|
||||||
export const settingsRouter = createTRPCRouter({
|
export const settingsRouter = createTRPCRouter({
|
||||||
reloadServer: adminProcedure.mutation(async () => {
|
reloadServer: adminProcedure.mutation(async () => {
|
||||||
await spawnAsync("docker", [
|
const { stdout } = await execAsync(
|
||||||
"service",
|
"docker service inspect dokploy-postgres --format '{{.ID}}'",
|
||||||
"update",
|
);
|
||||||
"--force",
|
await execAsync(`docker service update --force ${stdout.trim()}`);
|
||||||
"--image",
|
|
||||||
getDokployImage(),
|
|
||||||
"dokploy",
|
|
||||||
]);
|
|
||||||
return true;
|
return true;
|
||||||
}),
|
}),
|
||||||
reloadTraefik: adminProcedure.mutation(async () => {
|
reloadTraefik: adminProcedure.mutation(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user