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:
parent
dcd1df31c7
commit
fffe1d6249
@ -203,9 +203,6 @@ export const addDomainToCompose = async (
|
||||
if (!result?.services?.[serviceName]) {
|
||||
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");
|
||||
if (https) {
|
||||
@ -217,6 +214,11 @@ export const addDomainToCompose = async (
|
||||
httpLabels.push(...httpsLabels);
|
||||
}
|
||||
|
||||
if (compose.composeType === "docker-compose") {
|
||||
if (!result.services[serviceName].labels) {
|
||||
result.services[serviceName].labels = [];
|
||||
}
|
||||
|
||||
const labels = result.services[serviceName].labels;
|
||||
|
||||
if (Array.isArray(labels)) {
|
||||
@ -225,6 +227,23 @@ export const addDomainToCompose = async (
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// Add the dokploy-network to the service
|
||||
result.services[serviceName].networks = addDokployNetworkToService(
|
||||
|
Loading…
Reference in New Issue
Block a user