mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-29 14:48:47 +00:00
Merge pull request #4185 from Dokploy/fix/compose-delete-orphaned-containers
fix: prevent orphaned containers when deleting compose services
This commit is contained in:
@@ -440,17 +440,16 @@ export const removeCompose = async (
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const command = `
|
const command = `
|
||||||
docker network disconnect ${compose.appName} dokploy-traefik;
|
docker network disconnect ${compose.appName} dokploy-traefik;
|
||||||
cd ${projectPath} && env -i PATH="$PATH" docker compose -p ${compose.appName} down ${
|
env -i PATH="$PATH" docker compose -p ${compose.appName} down ${
|
||||||
deleteVolumes ? "--volumes" : ""
|
deleteVolumes ? "--volumes" : ""
|
||||||
} && rm -rf ${projectPath}`;
|
};
|
||||||
|
rm -rf ${projectPath}`;
|
||||||
|
|
||||||
if (compose.serverId) {
|
if (compose.serverId) {
|
||||||
await execAsyncRemote(compose.serverId, command);
|
await execAsyncRemote(compose.serverId, command);
|
||||||
} else {
|
} else {
|
||||||
await execAsync(command, {
|
await execAsync(command);
|
||||||
cwd: projectPath,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user