mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: remove duplicate case
This commit is contained in:
parent
fffe1d6249
commit
af083ffa5d
@ -214,20 +214,15 @@ export const addDomainToCompose = async (
|
|||||||
httpLabels.push(...httpsLabels);
|
httpLabels.push(...httpsLabels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let labels: DefinitionsService["labels"] = [];
|
||||||
if (compose.composeType === "docker-compose") {
|
if (compose.composeType === "docker-compose") {
|
||||||
if (!result.services[serviceName].labels) {
|
if (!result.services[serviceName].labels) {
|
||||||
result.services[serviceName].labels = [];
|
result.services[serviceName].labels = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const labels = result.services[serviceName].labels;
|
labels = result.services[serviceName].labels;
|
||||||
|
|
||||||
if (Array.isArray(labels)) {
|
|
||||||
if (!labels.includes("traefik.enable=true")) {
|
|
||||||
labels.push("traefik.enable=true");
|
|
||||||
}
|
|
||||||
labels.push(...httpLabels);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
// Stack Case
|
||||||
if (!result.services[serviceName].deploy) {
|
if (!result.services[serviceName].deploy) {
|
||||||
result.services[serviceName].deploy = {};
|
result.services[serviceName].deploy = {};
|
||||||
}
|
}
|
||||||
@ -235,14 +230,14 @@ export const addDomainToCompose = async (
|
|||||||
result.services[serviceName].deploy.labels = [];
|
result.services[serviceName].deploy.labels = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const labels = result.services[serviceName].deploy.labels;
|
labels = result.services[serviceName].deploy.labels;
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(labels)) {
|
if (Array.isArray(labels)) {
|
||||||
if (!labels.includes("traefik.enable=true")) {
|
if (!labels.includes("traefik.enable=true")) {
|
||||||
labels.push("traefik.enable=true");
|
labels.push("traefik.enable=true");
|
||||||
}
|
|
||||||
labels.push(...httpLabels);
|
|
||||||
}
|
}
|
||||||
|
labels.push(...httpLabels);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the dokploy-network to the service
|
// Add the dokploy-network to the service
|
||||||
|
Loading…
Reference in New Issue
Block a user