Skip to content

fix(docker): idle-exec with Podman support and enable cleanup by default - #97

Merged
AminDhouib merged 4 commits into
canaryfrom
port/upr-4346
Jul 16, 2026
Merged

AminDhouib merged 4 commits into
canaryfrom
port/upr-4346

Conversation

@AminDhouib

Copy link
Copy Markdown
Member

Summary

Ports the upstream "docker cleanup" fix:

  • packages/server/src/utils/docker/utils.ts: renames dockerSafeExec → dockerIdleExec and detects an idle host via pgrep -af "(docker|podman) [a-zA-Z]" (adds Podman support); consolidates the cleanup helpers (net −93 lines of duplication).
  • apps/dokploy/server/api/routers/settings.ts: replaces await cleanupAllBackground(serverId) with void cleanupAll(serverId) and returns a fixed { status: "scheduled", message: ... } response from the clean-all mutation (avoids gateway timeouts).
  • packages/server/src/db/schema/server.ts: enableDockerCleanup now defaults to true.
  • Test fixture (update-server-config.test.ts) and schema.dbml updated for the new default.

Ports Dokploy#4346 by @fir4tozden (authorship preserved via --author on a squashed apply of the 6-commit branch).

Adaptations

  • Preserved the fork's buildsConcurrency column on the server table (and its update-server-config.test.ts fixture). Upstream's enableDockerCleanup change sits on the adjacent line; a blind apply would have dropped buildsConcurrency.
  • Regenerated the drizzle migration for the fork as slot 0190 (0190_docker_cleanup_default_on.sql = ALTER TABLE "server" ALTER COLUMN "enableDockerCleanup" SET DEFAULT true;). Upstream's PR shipped no migration for this default change. The fork's web-server-settings table already defaults enableDockerCleanup to true, so only the server table needs the ALTER — the regenerated migration contains exactly that one statement.

Merge-order note

Carries drizzle migration 0190. Merge after fork #11/#12 (slots 0175/0176) and after the sibling PRs holding slots 0177–0189; sibling migration PRs conflict trivially in meta/_journal.json — keep both entries, idx-ordered. (My sibling slot 0189, the Dokploy#4070 port, needs no migration.) Shares apps/dokploy/server/api/routers/settings.ts and packages/server/src/utils/docker/utils.ts with any other docker-/log-cleanup ports in this wave — rebase-check whichever merges last.

Verification

  • pnpm --filter=dokploy run typecheck passes on this branch.
  • No orphaned dockerSafeExec or cleanupAllBackground references remain anywhere in the tree after the rename/removal.
  • Regenerated migration verified: journal entry idx=190, when=1784013000000, LF endings, single ALTER COLUMN ... SET DEFAULT statement.

fir4tozden and others added 4 commits July 12, 2026 16:13
- Rename dockerSafeExec to dockerIdleExec and detect idle state via pgrep
  for both docker and podman processes
- Replace cleanupAllBackground with void cleanupAll(...) and return a
  scheduled-status response from the clean-all settings mutation
- Default enableDockerCleanup to true on the server table

Carries drizzle migration 0190 (regenerated for the fork). Preserves the
fork buildsConcurrency column on the server table and its test fixture.

Ports Dokploy#4346 by @fir4tozden.
# Conflicts:
#	apps/dokploy/drizzle/meta/_journal.json
@AminDhouib
AminDhouib merged commit 09a6e6f into canary Jul 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants