Merge pull request #3030 from AlexTMjugador/fix/compose-domains

fix: ensure Compose Traefik domain labels are written to local daemons
This commit is contained in:
Mauricio Siu
2025-11-19 02:33:46 -06:00
committed by GitHub
2 changed files with 8 additions and 11 deletions
@@ -2,7 +2,7 @@ import { dirname, join } from "node:path";
import { paths } from "@dokploy/server/constants"; import { paths } from "@dokploy/server/constants";
import type { InferResultType } from "@dokploy/server/types/with"; import type { InferResultType } from "@dokploy/server/types/with";
import boxen from "boxen"; import boxen from "boxen";
import { writeDomainsToComposeRemote } from "../docker/domain"; import { writeDomainsToCompose } from "../docker/domain";
import { import {
encodeBase64, encodeBase64,
getEnviromentVariablesObject, getEnviromentVariablesObject,
@@ -22,7 +22,7 @@ export const getBuildComposeCommand = async (compose: ComposeNested) => {
const projectPath = join(COMPOSE_PATH, compose.appName, "code"); const projectPath = join(COMPOSE_PATH, compose.appName, "code");
const exportEnvCommand = getExportEnvCommand(compose); const exportEnvCommand = getExportEnvCommand(compose);
const newCompose = await writeDomainsToComposeRemote(compose, domains); const newCompose = await writeDomainsToCompose(compose, domains);
const logContent = ` const logContent = `
App Name: ${appName} App Name: ${appName}
Build Compose 🐳 Build Compose 🐳
+6 -9
View File
@@ -102,7 +102,7 @@ export const readComposeFile = async (compose: Compose) => {
return null; return null;
}; };
export const writeDomainsToComposeRemote = async ( export const writeDomainsToCompose = async (
compose: Compose, compose: Compose,
domains: Domain[], domains: Domain[],
) => { ) => {
@@ -120,19 +120,16 @@ echo "❌ Error: Compose file not found";
exit 1; exit 1;
`; `;
} }
if (compose.serverId) {
const composeString = stringify(composeConverted, { lineWidth: 1000 }); const composeString = stringify(composeConverted, { lineWidth: 1000 });
const encodedContent = encodeBase64(composeString); const encodedContent = encodeBase64(composeString);
return `echo "${encodedContent}" | base64 -d > "${path}";`; return `echo "${encodedContent}" | base64 -d > "${path}";`;
}
} catch (error) { } catch (error) {
// @ts-ignore // @ts-ignore
return `echo "❌ Has occured an error: ${error?.message || error}"; return `echo "❌ Has occurred an error: ${error?.message || error}";
exit 1; exit 1;
`; `;
} }
return "";
}; };
export const addDomainToCompose = async ( export const addDomainToCompose = async (
compose: Compose, compose: Compose,