Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: added env support to Dokploy stack compose #637

Open
wants to merge 11 commits into
base: canary
Choose a base branch
from
19 changes: 11 additions & 8 deletions packages/server/src/utils/builders/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ export const createCommand = (compose: ComposeNested) => {

let path = "";

if (sourceType !== "raw") {
path = compose.composePath;
} else {
if (sourceType === "raw") {
path =
composeType === "stack"
? "docker-compose.processed.yml"
: "docker-compose.yml";
} else {
path = compose.composePath;
}

console.log(path);
xenonwellz marked this conversation as resolved.
Show resolved Hide resolved

let command = "";

if (composeType === "docker-compose") {
Expand Down Expand Up @@ -203,11 +205,12 @@ const createEnvFile = (compose: ComposeNested) => {

export const processComposeFile = async (compose: ComposeNested) => {
const { COMPOSE_PATH } = paths();
const command = getProcessComposeFileCommand(compose);

await execAsync(command, {
cwd: join(COMPOSE_PATH, compose.appName, "code"),
});
if (compose.composeType === "stack") {
const command = getProcessComposeFileCommand(compose);
await execAsync(command, {
cwd: join(COMPOSE_PATH, compose.appName, "code"),
});
}
};

export const getProcessComposeFileCommand = (compose: ComposeNested) => {
Expand Down