mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-20 03:54:29 +00:00
fix(compose): regenerate mapping domain labels
This commit is contained in:
@@ -282,33 +282,31 @@ export const addDomainToCompose = async (
|
||||
labels = result.services[serviceName].deploy.labels;
|
||||
}
|
||||
|
||||
const networkLabel =
|
||||
compose.composeType === "docker-compose"
|
||||
? "traefik.docker.network"
|
||||
: "traefik.swarm.network";
|
||||
const networkName = compose.isolatedDeployment
|
||||
? compose.suffix || compose.appName
|
||||
: "dokploy-network";
|
||||
|
||||
if (Array.isArray(labels)) {
|
||||
if (!labels.includes("traefik.enable=true")) {
|
||||
labels.unshift("traefik.enable=true");
|
||||
}
|
||||
labels.unshift(...httpLabels);
|
||||
if (!compose.isolatedDeployment) {
|
||||
if (compose.composeType === "docker-compose") {
|
||||
if (!labels.includes("traefik.docker.network=dokploy-network")) {
|
||||
labels.unshift("traefik.docker.network=dokploy-network");
|
||||
}
|
||||
} else {
|
||||
// Stack Case
|
||||
if (!labels.includes("traefik.swarm.network=dokploy-network")) {
|
||||
labels.unshift("traefik.swarm.network=dokploy-network");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const isolatedNetwork = compose.suffix || compose.appName;
|
||||
if (compose.composeType === "docker-compose") {
|
||||
if (!labels.includes(`traefik.docker.network=${isolatedNetwork}`)) {
|
||||
labels.unshift(`traefik.docker.network=${isolatedNetwork}`);
|
||||
}
|
||||
} else {
|
||||
if (!labels.includes(`traefik.swarm.network=${isolatedNetwork}`)) {
|
||||
labels.unshift(`traefik.swarm.network=${isolatedNetwork}`);
|
||||
}
|
||||
}
|
||||
const networkLabelEntry = `${networkLabel}=${networkName}`;
|
||||
if (!labels.includes(networkLabelEntry)) {
|
||||
labels.unshift(networkLabelEntry);
|
||||
}
|
||||
} else if (labels) {
|
||||
labels["traefik.enable"] = "true";
|
||||
labels[networkLabel] = networkName;
|
||||
for (const label of httpLabels) {
|
||||
const separatorIndex = label.indexOf("=");
|
||||
labels[label.slice(0, separatorIndex)] = label.slice(
|
||||
separatorIndex + 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user