Skip to content

Commit a5abd46

Browse files
authored
Merge pull request #3071 from Dokploy/fix/adjust-export-envs-stack
fix: improve Docker command execution by including environment variab…
2 parents 2e702dc + ad0e044 commit a5abd46

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

apps/dokploy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dokploy",
3-
"version": "v0.25.9",
3+
"version": "v0.25.10",
44
"private": true,
55
"license": "Apache-2.0",
66
"type": "module",

packages/server/src/utils/builders/compose.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ Compose Type: ${composeType} ✅`;
5353
5454
cd "${projectPath}";
5555
56-
${exportEnvCommand}
5756
${compose.isolatedDeployment ? `docker network inspect ${compose.appName} >/dev/null 2>&1 || docker network create --attachable ${compose.appName}` : ""}
58-
env -i PATH="$PATH" docker ${command.split(" ").join(" ")} 2>&1 || { echo "Error: ❌ Docker command failed"; exit 1; }
57+
env -i PATH="$PATH" ${exportEnvCommand} docker ${command.split(" ").join(" ")} 2>&1 || { echo "Error: ❌ Docker command failed"; exit 1; }
5958
${compose.isolatedDeployment ? `docker network connect ${compose.appName} $(docker ps --filter "name=dokploy-traefik" -q) >/dev/null 2>&1` : ""}
6059
6160
echo "Docker Compose Deployed: ✅";
@@ -66,7 +65,6 @@ Compose Type: ${composeType} ✅`;
6665
`;
6766

6867
return bashCommand;
69-
// return await execAsyncRemote(compose.serverId, bashCommand);
7068
};
7169

7270
const sanitizeCommand = (command: string) => {
@@ -138,8 +136,8 @@ const getExportEnvCommand = (compose: ComposeNested) => {
138136
compose.environment.project.env,
139137
);
140138
const exports = Object.entries(envVars)
141-
.map(([key, value]) => `export ${key}=${quote([value])}`)
142-
.join("\n");
139+
.map(([key, value]) => `${key}=${quote([value])}`)
140+
.join(" ");
143141

144-
return exports ? `\n# Export environment variables\n${exports}\n` : "";
142+
return exports ? `${exports}` : "";
145143
};

0 commit comments

Comments
 (0)