From 32f61b5e9bbc6e17c735e1f8efee52c470b9fd64 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 3 Aug 2025 01:47:31 -0600 Subject: [PATCH] refactor(docker): update docker exec command to set working directory for terminal sessions --- apps/dokploy/server/wss/docker-container-terminal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/server/wss/docker-container-terminal.ts b/apps/dokploy/server/wss/docker-container-terminal.ts index 2f25edb1a..e39db53fa 100644 --- a/apps/dokploy/server/wss/docker-container-terminal.ts +++ b/apps/dokploy/server/wss/docker-container-terminal.ts @@ -55,7 +55,7 @@ export const setupDockerContainerTerminalWebSocketServer = ( conn .once("ready", () => { conn.exec( - `docker exec -it ${containerId} ${activeWay}`, + `docker exec -it -w / ${containerId} ${activeWay}`, { pty: true }, (err, stream) => { if (err) throw err; @@ -107,7 +107,7 @@ export const setupDockerContainerTerminalWebSocketServer = ( const shell = getShell(); const ptyProcess = spawn( shell, - ["-c", `docker exec -it ${containerId} ${activeWay}`], + ["-c", `docker exec -it -w / ${containerId} ${activeWay}`], {}, );