From 48642979c56a0ee7a79352301839457f9973bcda Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 4 Feb 2025 17:17:43 +0530 Subject: [PATCH] chore: make erpnext template more configurable --- apps/dokploy/templates/erpnext/docker-compose.yml | 14 +++++++++++--- apps/dokploy/templates/erpnext/index.ts | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/templates/erpnext/docker-compose.yml b/apps/dokploy/templates/erpnext/docker-compose.yml index def916be..28cd8f6a 100644 --- a/apps/dokploy/templates/erpnext/docker-compose.yml +++ b/apps/dokploy/templates/erpnext/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 @@ -210,7 +210,7 @@ services: entrypoint: ["bash", "-c"] command: - > - wait-for-it -t 120 db:3306; + wait-for-it -t 120 $$DB_HOST:$$DB_PORT; wait-for-it -t 120 redis-cache:6379; wait-for-it -t 120 redis-queue:6379; export start=`date +%s`; @@ -231,10 +231,12 @@ services: volumes: - sites:/home/frappe/frappe-bench/sites environment: + SITE_NAME: ${SITE_NAME} ADMIN_PASSWORD: ${ADMIN_PASSWORD} + DB_HOST: ${DB_HOST:-db} + DB_PORT: "${DB_PORT:-3306}" DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} INSTALL_APP_ARGS: ${INSTALL_APP_ARGS} - SITE_NAME: ${SITE_NAME} networks: - bench-network @@ -262,6 +264,8 @@ services: db: image: mariadb:10.6 deploy: + mode: replicated + replicas: ${ENABLE_DB:-0} restart_policy: condition: always healthcheck: @@ -341,6 +345,10 @@ volumes: redis-queue-data: redis-socketio-data: sites: + driver_opts: + type: "${SITE_VOLUME_TYPE}" + o: "${SITE_VOLUME_OPTS}" + device: "${SITE_VOLUME_DEV}" networks: bench-network: \ No newline at end of file diff --git a/apps/dokploy/templates/erpnext/index.ts b/apps/dokploy/templates/erpnext/index.ts index 0be46c44..5b7543b9 100644 --- a/apps/dokploy/templates/erpnext/index.ts +++ b/apps/dokploy/templates/erpnext/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",