MCPcopy
hub / github.com/Dokploy/dokploy / getCreateComposeFileCommand

Function getCreateComposeFileCommand

packages/server/src/utils/providers/raw.ts:6–19  ·  view source on GitHub ↗
(compose: Compose)

Source from the content-addressed store, hash-verified

4import { encodeBase64 } from "../docker/utils";
5
6export const getCreateComposeFileCommand = (compose: Compose) => {
7 const { COMPOSE_PATH } = paths(!!compose.serverId);
8 const { appName, composeFile } = compose;
9 const outputPath = join(COMPOSE_PATH, appName, "code");
10 const filePath = join(outputPath, "docker-compose.yml");
11 const encodedContent = encodeBase64(composeFile);
12 const bashCommand = `
13 rm -rf ${outputPath};
14 mkdir -p ${outputPath};
15 echo "${encodedContent}" | base64 -d > "${filePath}";
16 echo "File 'docker-compose.yml' created: ✅";
17 `;
18 return bashCommand;
19};

Callers 3

cloneComposeFunction · 0.90
deployComposeFunction · 0.90
rebuildComposeFunction · 0.90

Calls 2

pathsFunction · 0.90
encodeBase64Function · 0.90

Tested by

no test coverage detected