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.
This commit is contained in:
Horsley Lee
2026-02-07 15:29:43 +08:00
parent 4eae1a5c14
commit ccaac28f08

View File

@@ -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";