mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: labels not added correctly when using "stack" type docker dompose file
This commit is contained in:
@@ -203,9 +203,6 @@ export const addDomainToCompose = async (
|
|||||||
if (!result?.services?.[serviceName]) {
|
if (!result?.services?.[serviceName]) {
|
||||||
throw new Error(`The service ${serviceName} not found in the compose`);
|
throw new Error(`The service ${serviceName} not found in the compose`);
|
||||||
}
|
}
|
||||||
if (!result.services[serviceName].labels) {
|
|
||||||
result.services[serviceName].labels = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const httpLabels = await createDomainLabels(appName, domain, "web");
|
const httpLabels = await createDomainLabels(appName, domain, "web");
|
||||||
if (https) {
|
if (https) {
|
||||||
@@ -217,13 +214,35 @@ export const addDomainToCompose = async (
|
|||||||
httpLabels.push(...httpsLabels);
|
httpLabels.push(...httpsLabels);
|
||||||
}
|
}
|
||||||
|
|
||||||
const labels = result.services[serviceName].labels;
|
if (compose.composeType === "docker-compose") {
|
||||||
|
if (!result.services[serviceName].labels) {
|
||||||
if (Array.isArray(labels)) {
|
result.services[serviceName].labels = [];
|
||||||
if (!labels.includes("traefik.enable=true")) {
|
}
|
||||||
labels.push("traefik.enable=true");
|
|
||||||
|
const labels = result.services[serviceName].labels;
|
||||||
|
|
||||||
|
if (Array.isArray(labels)) {
|
||||||
|
if (!labels.includes("traefik.enable=true")) {
|
||||||
|
labels.push("traefik.enable=true");
|
||||||
|
}
|
||||||
|
labels.push(...httpLabels);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!result.services[serviceName].deploy) {
|
||||||
|
result.services[serviceName].deploy = {};
|
||||||
|
}
|
||||||
|
if (!result.services[serviceName].deploy.labels) {
|
||||||
|
result.services[serviceName].deploy.labels = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const labels = result.services[serviceName].deploy.labels;
|
||||||
|
|
||||||
|
if (Array.isArray(labels)) {
|
||||||
|
if (!labels.includes("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
|
||||||
|
|||||||
Reference in New Issue
Block a user