From 0bd0da2ee4598f064fc5f4ff85bec963b3d44b82 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:44:21 -0600 Subject: [PATCH] fix(raw): add raw compose remote --- apps/dokploy/server/utils/providers/raw.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/server/utils/providers/raw.ts b/apps/dokploy/server/utils/providers/raw.ts index 43228bb8..ea4253e7 100644 --- a/apps/dokploy/server/utils/providers/raw.ts +++ b/apps/dokploy/server/utils/providers/raw.ts @@ -32,7 +32,13 @@ export const getCreateComposeFileCommand = (compose: Compose) => { const { appName, composeFile } = compose; const outputPath = join(COMPOSE_PATH, appName, "code"); const filePath = join(outputPath, "docker-compose.yml"); - return `echo "${composeFile}" > ${filePath}`; + const command = []; + command.push(`rm -rf ${outputPath};`); + command.push(`mkdir -p ${outputPath};`); + command.push( + `printf '%s' '${composeFile.replace(/'/g, "'\\''")}' > ${filePath};`, + ); + return command.join("\n"); }; export const createComposeFileRaw = async (compose: Compose) => {