From 8c889fc71e084bb997a4bab55c85189cd7d04047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=84=D1=8B=D1=80=D0=B0=D1=82=20=D1=91=D0=B7=D0=B4=D1=8D?= =?UTF-8?q?=D0=BD?= <31664778+fir4tozden@users.noreply.github.com> Date: Wed, 10 Dec 2025 22:06:55 +0300 Subject: [PATCH 1/3] fix: some fixes in dockerSafeExec() --- packages/server/src/utils/docker/utils.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/server/src/utils/docker/utils.ts b/packages/server/src/utils/docker/utils.ts index 5c7326e2d..f8518bd90 100644 --- a/packages/server/src/utils/docker/utils.ts +++ b/packages/server/src/utils/docker/utils.ts @@ -146,17 +146,17 @@ export const getContainerByName = (name: string): Promise => { }; /** - * Docker commands passed through this method are held during Docker's build or pull process. + * Docker commands sent using this method are held in a hold when Docker is busy. * * https://github.com/Dokploy/dokploy/pull/3064 - * https://github.com/fir4tozden */ -export const dockerSafeExec = (exec: string) => `CHECK_INTERVAL=10 +export const dockerSafeExec = (exec: string) => ` +CHECK_INTERVAL=10 echo "Preparing for execution..." while true; do - PROCESSES=$(ps aux | grep -E "docker build|docker pull" | grep -v grep) + PROCESSES=$(ps aux | grep -E "docker " | grep -v grep) if [ -z "$PROCESSES" ]; then echo "Docker is idle. Starting execution..." @@ -169,7 +169,8 @@ done ${exec} -echo "Execution completed."`; +echo "Execution completed." +`; export const cleanupContainers = async (serverId?: string) => { try { From 4c1005639414c798e0552268f38e0eecee92bd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=84=D1=8B=D1=80=D0=B0=D1=82=20=D1=91=D0=B7=D0=B4=D1=8D?= =?UTF-8?q?=D0=BD?= <31664778+fir4tozden@users.noreply.github.com> Date: Sun, 14 Dec 2025 07:24:27 +0300 Subject: [PATCH 2/3] chore --- packages/server/src/utils/docker/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utils/docker/utils.ts b/packages/server/src/utils/docker/utils.ts index f8518bd90..6f0e433b9 100644 --- a/packages/server/src/utils/docker/utils.ts +++ b/packages/server/src/utils/docker/utils.ts @@ -156,7 +156,7 @@ CHECK_INTERVAL=10 echo "Preparing for execution..." while true; do - PROCESSES=$(ps aux | grep -E "docker " | grep -v grep) + PROCESSES=$(ps aux | grep -E "^.*docker [a-z]" | grep -v grep) if [ -z "$PROCESSES" ]; then echo "Docker is idle. Starting execution..." From 5d427379434ffcaac7550dd85ea7577f5d0eacd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=84=D1=8B=D1=80=D0=B0=D1=82=20=D1=91=D0=B7=D0=B4=D1=8D?= =?UTF-8?q?=D0=BD?= <31664778+fir4tozden@users.noreply.github.com> Date: Sun, 14 Dec 2025 07:32:28 +0300 Subject: [PATCH 3/3] cepte --- packages/server/src/utils/docker/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utils/docker/utils.ts b/packages/server/src/utils/docker/utils.ts index 6f0e433b9..1f5e54978 100644 --- a/packages/server/src/utils/docker/utils.ts +++ b/packages/server/src/utils/docker/utils.ts @@ -156,7 +156,7 @@ CHECK_INTERVAL=10 echo "Preparing for execution..." while true; do - PROCESSES=$(ps aux | grep -E "^.*docker [a-z]" | grep -v grep) + PROCESSES=$(ps aux | grep -E "^.*docker [A-Za-z]" | grep -v grep) if [ -z "$PROCESSES" ]; then echo "Docker is idle. Starting execution..."