From dc8148ae51e5d67ebf0081704bf41e6ccc2204b9 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Wed, 4 Feb 2026 08:58:10 -0600 Subject: [PATCH] fix(db): update database URL configuration for production and development environments - Modified the database URL assignment logic to differentiate between production and development environments. - Ensured that the correct database URL is used based on the NODE_ENV variable, improving deployment flexibility. --- packages/server/src/db/constants.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/server/src/db/constants.ts b/packages/server/src/db/constants.ts index e520235f9..e5172740b 100644 --- a/packages/server/src/db/constants.ts +++ b/packages/server/src/db/constants.ts @@ -34,7 +34,12 @@ if (DATABASE_URL) { Please migrate to Docker Secrets using POSTGRES_PASSWORD_FILE. Please execute this command in your server: curl -sSL https://dokploy.com/security/0.26.6.sh | bash `); - // postgres://dokploy:amukds4wi9001583845717ad2@localhost:5432/dokploy - dbUrl = - "postgres://dokploy:amukds4wi9001583845717ad2@dokploy-postgres:5432/dokploy"; + + if (process.env.NODE_ENV === "production") { + dbUrl = + "postgres://dokploy:amukds4wi9001583845717ad2@dokploy-postgres:5432/dokploy"; + } else { + dbUrl = + "postgres://dokploy:amukds4wi9001583845717ad2@localhost:5432/dokploy"; + } }