Skip to content

Commit 1053743

Browse files
committed
fix: close terminal websocket when local container shell exits
1 parent 355b856 commit 1053743

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎apps/dokploy/server/wss/docker-container-terminal.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ export const setupDockerContainerTerminalWebSocketServer = (
182182
ptyProcess.onData((data) => {
183183
ws.send(data);
184184
});
185+
ptyProcess.onExit(({ exitCode }) => {
186+
ws.send(`\nContainer closed with code: ${exitCode}\n`);
187+
ws.close();
188+
});
185189
ws.on("close", () => {
186190
ptyProcess.kill();
187191
});

0 commit comments

Comments
 (0)