mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #1814 from Dokploy/1690-remove-unused-networks-when-removing-projects-or-apps
Enhance compose removal process by adding network disconnection command
This commit is contained in:
commit
c13a68dab4
@ -478,7 +478,9 @@ export const removeCompose = async (
|
||||
const projectPath = join(COMPOSE_PATH, compose.appName);
|
||||
|
||||
if (compose.composeType === "stack") {
|
||||
const command = `cd ${projectPath} && docker stack rm ${compose.appName} && rm -rf ${projectPath}`;
|
||||
const command = `
|
||||
docker network disconnect ${compose.appName} dokploy-traefik;
|
||||
cd ${projectPath} && docker stack rm ${compose.appName} && rm -rf ${projectPath}`;
|
||||
|
||||
if (compose.serverId) {
|
||||
await execAsyncRemote(compose.serverId, command);
|
||||
@ -489,12 +491,11 @@ export const removeCompose = async (
|
||||
cwd: projectPath,
|
||||
});
|
||||
} else {
|
||||
let command: string;
|
||||
if (deleteVolumes) {
|
||||
command = `cd ${projectPath} && docker compose -p ${compose.appName} down --volumes && rm -rf ${projectPath}`;
|
||||
} else {
|
||||
command = `cd ${projectPath} && docker compose -p ${compose.appName} down && rm -rf ${projectPath}`;
|
||||
}
|
||||
const command = `
|
||||
docker network disconnect ${compose.appName} dokploy-traefik;
|
||||
cd ${projectPath} && docker compose -p ${compose.appName} down ${
|
||||
deleteVolumes ? "--volumes" : ""
|
||||
} && rm -rf ${projectPath}`;
|
||||
|
||||
if (compose.serverId) {
|
||||
await execAsyncRemote(compose.serverId, command);
|
||||
|
@ -40,8 +40,6 @@ export const getServiceImageDigest = async () => {
|
||||
"docker service inspect dokploy --format '{{.Spec.TaskTemplate.ContainerSpec.Image}}'",
|
||||
);
|
||||
|
||||
console.log("stdout", stdout);
|
||||
|
||||
const currentDigest = stdout.trim().split("@")[1];
|
||||
|
||||
if (!currentDigest) {
|
||||
|
Loading…
Reference in New Issue
Block a user