From ccaac28f08c51e2c2aea48d4438de63d07c251d6 Mon Sep 17 00:00:00 2001 From: Horsley Lee Date: Sat, 7 Feb 2026 15:29:43 +0800 Subject: [PATCH] fix: avoid database connection during setup by using native exec The setup.ts script imports execAsync from @dokploy/server, which triggers the entire package to load including lib/auth.ts. This module initializes betterAuth() with a database connection at import time, causing the setup script to fail with ECONNREFUSED before the database container is created. This fix replaces the import with Node.js native promisify(exec), avoiding the module side-effect that attempts database connection during setup. --- apps/dokploy/setup.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/setup.ts b/apps/dokploy/setup.ts index 20a0b430f..682fcb478 100644 --- a/apps/dokploy/setup.ts +++ b/apps/dokploy/setup.ts @@ -1,5 +1,8 @@ import { exit } from "node:process"; -import { execAsync } from "@dokploy/server"; +import { exec } from "node:child_process"; +import { promisify } from "node:util"; + +const execAsync = promisify(exec); import { setupDirectories } from "@dokploy/server/setup/config-paths"; import { initializePostgres } from "@dokploy/server/setup/postgres-setup"; import { initializeRedis } from "@dokploy/server/setup/redis-setup";