fix traefik 3.5.0 error

fix traefik error:"both Docker and Swarm labels are defined"
This commit is contained in:
永恒
2025-09-08 12:26:36 +08:00
committed by GitHub
parent 24729f35ec
commit 1664ae9b92
@@ -251,14 +251,18 @@ export const addDomainToCompose = async (
} }
labels.unshift(...httpLabels); labels.unshift(...httpLabels);
if (!compose.isolatedDeployment) { if (!compose.isolatedDeployment) {
if (compose.composeType === "docker-compose") {
if (!labels.includes("traefik.docker.network=dokploy-network")) { if (!labels.includes("traefik.docker.network=dokploy-network")) {
labels.unshift("traefik.docker.network=dokploy-network"); labels.unshift("traefik.docker.network=dokploy-network");
} }
} else {
// Stack Case
if (!labels.includes("traefik.swarm.network=dokploy-network")) { if (!labels.includes("traefik.swarm.network=dokploy-network")) {
labels.unshift("traefik.swarm.network=dokploy-network"); labels.unshift("traefik.swarm.network=dokploy-network");
} }
} }
} }
}
if (!compose.isolatedDeployment) { if (!compose.isolatedDeployment) {
// Add the dokploy-network to the service // Add the dokploy-network to the service