Merge pull request #1217 from Dokploy/1177-when-deploying-applications-through-autodeploy-docker-cannot-update

refactor: make less aggressive cleanups
This commit is contained in:
Mauricio Siu 2025-01-26 16:25:16 -06:00 committed by GitHub
commit 780fa6b9cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 4368 additions and 15 deletions

View File

@ -0,0 +1,3 @@
-- Custom SQL migration file, put you code below!
UPDATE "admin" SET "cleanupCacheApplications" = false;

File diff suppressed because it is too large Load Diff

View File

@ -421,6 +421,13 @@
"when": 1737615160768,
"tag": "0059_striped_bill_hollister",
"breakpoints": true
},
{
"idx": 60,
"version": "6",
"when": 1737929896838,
"tag": "0060_disable-aggressive-cache",
"breakpoints": true
}
]
}

View File

@ -216,8 +216,8 @@ echo "$json_output"
};
export const cleanupFullDocker = async (serverId?: string | null) => {
const cleanupImages = "docker image prune --all --force";
const cleanupVolumes = "docker volume prune --all --force";
const cleanupImages = "docker image prune --force";
const cleanupVolumes = "docker volume prune --force";
const cleanupContainers = "docker container prune --force";
const cleanupSystem = "docker system prune --all --force --volumes";
const cleanupBuilder = "docker builder prune --all --force";

View File

@ -144,10 +144,11 @@ export const getContainerByName = (name: string): Promise<ContainerInfo> => {
};
export const cleanUpUnusedImages = async (serverId?: string) => {
try {
const command = "docker image prune --force";
if (serverId) {
await execAsyncRemote(serverId, "docker image prune --all --force");
await execAsyncRemote(serverId, command);
} else {
await execAsync("docker image prune --all --force");
await execAsync(command);
}
} catch (error) {
console.error(error);
@ -157,10 +158,11 @@ export const cleanUpUnusedImages = async (serverId?: string) => {
export const cleanStoppedContainers = async (serverId?: string) => {
try {
const command = "docker container prune --force";
if (serverId) {
await execAsyncRemote(serverId, "docker container prune --force");
await execAsyncRemote(serverId, command);
} else {
await execAsync("docker container prune --force");
await execAsync(command);
}
} catch (error) {
console.error(error);
@ -170,10 +172,11 @@ export const cleanStoppedContainers = async (serverId?: string) => {
export const cleanUpUnusedVolumes = async (serverId?: string) => {
try {
const command = "docker volume prune --force";
if (serverId) {
await execAsyncRemote(serverId, "docker volume prune --all --force");
await execAsyncRemote(serverId, command);
} else {
await execAsync("docker volume prune --all --force");
await execAsync(command);
}
} catch (error) {
console.error(error);
@ -199,21 +202,20 @@ export const cleanUpInactiveContainers = async () => {
};
export const cleanUpDockerBuilder = async (serverId?: string) => {
const command = "docker builder prune --all --force";
if (serverId) {
await execAsyncRemote(serverId, "docker builder prune --all --force");
await execAsyncRemote(serverId, command);
} else {
await execAsync("docker builder prune --all --force");
await execAsync(command);
}
};
export const cleanUpSystemPrune = async (serverId?: string) => {
const command = "docker system prune --all --force --volumes";
if (serverId) {
await execAsyncRemote(
serverId,
"docker system prune --all --force --volumes",
);
await execAsyncRemote(serverId, command);
} else {
await execAsync("docker system prune --all --force --volumes");
await execAsync(command);
}
};