From 19ae575fa8acdffed4734e6823fd95bbdb021025 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sun, 5 Apr 2026 13:28:18 -0600 Subject: [PATCH] fix: patches not applied to compose services writeDomainsToCompose reads the compose file in Node.js before the shell script runs, so patches applied as shell commands were being overwritten by the stale pre-patch content. Split patch execution into a separate step that runs before getBuildComposeCommand, so the file is already patched when Node.js reads it for domain injection. Also added missing patch support to rebuildCompose which was skipping patches entirely on redeploys. Closes #4113 --- packages/server/src/services/compose.ts | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/server/src/services/compose.ts b/packages/server/src/services/compose.ts index 71876a3ee..5db6526a6 100644 --- a/packages/server/src/services/compose.ts +++ b/packages/server/src/services/compose.ts @@ -251,15 +251,22 @@ export const deployCompose = async ({ } else { await execAsync(commandWithLog); } - command = "set -e;"; if (compose.sourceType !== "raw") { + command = "set -e;"; command += await generateApplyPatchesCommand({ id: compose.composeId, type: "compose", serverId: compose.serverId, }); + commandWithLog = `(${command}) >> ${deployment.logPath} 2>&1`; + if (compose.serverId) { + await execAsyncRemote(compose.serverId, commandWithLog); + } else { + await execAsync(commandWithLog); + } } + command = "set -e;"; command += await getBuildComposeCommand(entity); commandWithLog = `(${command}) >> ${deployment.logPath} 2>&1`; if (compose.serverId) { @@ -357,6 +364,23 @@ export const rebuildCompose = async ({ } else { await execAsync(commandWithLog); } + + if (compose.sourceType !== "raw") { + command = "set -e;"; + command += await generateApplyPatchesCommand({ + id: compose.composeId, + type: "compose", + serverId: compose.serverId, + }); + commandWithLog = `(${command}) >> ${deployment.logPath} 2>&1`; + if (compose.serverId) { + await execAsyncRemote(compose.serverId, commandWithLog); + } else { + await execAsync(commandWithLog); + } + } + + command = "set -e;"; command += await getBuildComposeCommand(compose); commandWithLog = `(${command}) >> ${deployment.logPath} 2>&1`; if (compose.serverId) {