MCPcopy Index your code
hub / github.com/Dokploy/dokploy / createCommand

Function createCommand

packages/server/src/utils/builders/compose.ts:80–97  ·  view source on GitHub ↗
(compose: ComposeNested)

Source from the content-addressed store, hash-verified

78};
79
80export const createCommand = (compose: ComposeNested) => {
81 const { composeType, appName, sourceType } = compose;
82 if (compose.command) {
83 return `${sanitizeCommand(compose.command)}`;
84 }
85
86 const path =
87 sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
88 let command = "";
89
90 if (composeType === "docker-compose") {
91 command = `compose -p ${appName} -f ${path} up -d --build --remove-orphans`;
92 } else if (composeType === "stack") {
93 command = `stack deploy -c ${path} ${appName} --prune --with-registry-auth`;
94 }
95
96 return command;
97};
98
99export const getCreateEnvFileCommand = (compose: ComposeNested) => {
100 const { COMPOSE_PATH } = paths(!!compose.serverId);

Callers 2

compose.tsFile · 0.90
getBuildComposeCommandFunction · 0.85

Calls 1

sanitizeCommandFunction · 0.85

Tested by

no test coverage detected