Skip to content

Commit f656e62

Browse files
authored
Merge pull request #3692 from vprudnikoff/fix/stack-rm-compose-directory-dependency
fix: prevent orphaned docker stacks when compose directory is missing
2 parents f5635f6 + 343a84d commit f656e62

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/server/src/services/compose.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,14 @@ export const removeCompose = async (
395395
if (compose.composeType === "stack") {
396396
const command = `
397397
docker network disconnect ${compose.appName} dokploy-traefik;
398-
cd ${projectPath} && docker stack rm ${compose.appName} && rm -rf ${projectPath}`;
398+
docker stack rm ${compose.appName};
399+
rm -rf ${projectPath}`;
399400

400401
if (compose.serverId) {
401402
await execAsyncRemote(compose.serverId, command);
402403
} else {
403404
await execAsync(command);
404405
}
405-
await execAsync(command, {
406-
cwd: projectPath,
407-
});
408406
} else {
409407
const command = `
410408
docker network disconnect ${compose.appName} dokploy-traefik;

0 commit comments

Comments
 (0)