Merge pull request #4185 from Dokploy/fix/compose-delete-orphaned-containers

fix: prevent orphaned containers when deleting compose services
This commit is contained in:
Mauricio Siu
2026-04-09 16:26:31 -06:00
committed by GitHub

View File

@@ -440,17 +440,16 @@ export const removeCompose = async (
}
} else {
const command = `
docker network disconnect ${compose.appName} dokploy-traefik;
cd ${projectPath} && env -i PATH="$PATH" docker compose -p ${compose.appName} down ${
docker network disconnect ${compose.appName} dokploy-traefik;
env -i PATH="$PATH" docker compose -p ${compose.appName} down ${
deleteVolumes ? "--volumes" : ""
} && rm -rf ${projectPath}`;
};
rm -rf ${projectPath}`;
if (compose.serverId) {
await execAsyncRemote(compose.serverId, command);
} else {
await execAsync(command, {
cwd: projectPath,
});
await execAsync(command);
}
}
} catch (error) {