From 65780ee8528cfb78ba8d124884c83de52c7c24a7 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 4 Feb 2025 13:57:49 +0530 Subject: [PATCH] feat: make db configurable --- apps/dokploy/templates/frappe-hr/docker-compose.yml | 4 +++- apps/dokploy/templates/frappe-hr/index.ts | 2 ++ apps/dokploy/templates/listmonk/index.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/templates/frappe-hr/docker-compose.yml b/apps/dokploy/templates/frappe-hr/docker-compose.yml index 3ed923ea..29ba0069 100644 --- a/apps/dokploy/templates/frappe-hr/docker-compose.yml +++ b/apps/dokploy/templates/frappe-hr/docker-compose.yml @@ -189,7 +189,7 @@ services: bench set-config -g redis_socketio "redis://$$REDIS_QUEUE"; bench set-config -gp socketio_port $$SOCKETIO_PORT; environment: - DB_HOST: db + DB_HOST: "${DB_HOST:-db}" DB_PORT: "3306" REDIS_CACHE: redis-cache:6379 REDIS_QUEUE: redis-queue:6379 @@ -262,6 +262,8 @@ services: db: image: mariadb:10.6 deploy: + mode: replicated + replicas: ${ENABLE_DB:-0} restart_policy: condition: always healthcheck: diff --git a/apps/dokploy/templates/frappe-hr/index.ts b/apps/dokploy/templates/frappe-hr/index.ts index 7a2f501f..1e6b9474 100644 --- a/apps/dokploy/templates/frappe-hr/index.ts +++ b/apps/dokploy/templates/frappe-hr/index.ts @@ -24,6 +24,8 @@ export function generate(schema: Schema): Template { `ADMIN_PASSWORD=${adminPassword}`, `DB_ROOT_PASSWORD=${dbRootPassword}`, "MIGRATE=1", + "ENABLE_DB=1", + "DB_HOST=db", "CREATE_SITE=1", "CONFIGURE=1", "REGENERATE_APPS_TXT=1", diff --git a/apps/dokploy/templates/listmonk/index.ts b/apps/dokploy/templates/listmonk/index.ts index 113b3862..2a25efca 100644 --- a/apps/dokploy/templates/listmonk/index.ts +++ b/apps/dokploy/templates/listmonk/index.ts @@ -17,7 +17,7 @@ export function generate(schema: Schema): Template { ]; const envs = [ - `# visit the page to setup your super admin user`, + "# visit the page to setup your super admin user", "# check config.toml in Advanced / Volumes for more options", ];