Skip to content

Commit f53e1a6

Browse files
authored
Merge pull request #3030 from AlexTMjugador/fix/compose-domains
fix: ensure Compose Traefik domain labels are written to local daemons
2 parents 9e2788e + 3a17c9b commit f53e1a6

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

packages/server/src/utils/builders/compose.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { dirname, join } from "node:path";
22
import { paths } from "@dokploy/server/constants";
33
import type { InferResultType } from "@dokploy/server/types/with";
44
import boxen from "boxen";
5-
import { writeDomainsToComposeRemote } from "../docker/domain";
5+
import { writeDomainsToCompose } from "../docker/domain";
66
import {
77
encodeBase64,
88
getEnviromentVariablesObject,
@@ -22,7 +22,7 @@ export const getBuildComposeCommand = async (compose: ComposeNested) => {
2222
const projectPath = join(COMPOSE_PATH, compose.appName, "code");
2323
const exportEnvCommand = getExportEnvCommand(compose);
2424

25-
const newCompose = await writeDomainsToComposeRemote(compose, domains);
25+
const newCompose = await writeDomainsToCompose(compose, domains);
2626
const logContent = `
2727
App Name: ${appName}
2828
Build Compose 🐳

packages/server/src/utils/docker/domain.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const readComposeFile = async (compose: Compose) => {
102102
return null;
103103
};
104104

105-
export const writeDomainsToComposeRemote = async (
105+
export const writeDomainsToCompose = async (
106106
compose: Compose,
107107
domains: Domain[],
108108
) => {
@@ -120,19 +120,16 @@ echo "❌ Error: Compose file not found";
120120
exit 1;
121121
`;
122122
}
123-
if (compose.serverId) {
124-
const composeString = stringify(composeConverted, { lineWidth: 1000 });
125-
const encodedContent = encodeBase64(composeString);
126-
return `echo "${encodedContent}" | base64 -d > "${path}";`;
127-
}
123+
124+
const composeString = stringify(composeConverted, { lineWidth: 1000 });
125+
const encodedContent = encodeBase64(composeString);
126+
return `echo "${encodedContent}" | base64 -d > "${path}";`;
128127
} catch (error) {
129128
// @ts-ignore
130-
return `echo "❌ Has occured an error: ${error?.message || error}";
129+
return `echo "❌ Has occurred an error: ${error?.message || error}";
131130
exit 1;
132131
`;
133132
}
134-
135-
return "";
136133
};
137134
export const addDomainToCompose = async (
138135
compose: Compose,

0 commit comments

Comments
 (0)