From ec1735a0055458db80d1cdd92a835ca28db82bbb Mon Sep 17 00:00:00 2001 From: f Date: Fri, 11 Apr 2025 17:00:56 -0300 Subject: [PATCH] feat: set db type --- compose.postgresql.yml | 1 + entrypoint.sh.tmpl | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compose.postgresql.yml b/compose.postgresql.yml index 591ee29..91a0532 100644 --- a/compose.postgresql.yml +++ b/compose.postgresql.yml @@ -2,6 +2,7 @@ version: "3.8" services: app: environment: + - CMD_DB_TYPE=postgres - CMD_DB_NAME=codimd - CMD_DB_USER=codimd - CMD_DB_HOST=db diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index f7cf908..b61454e 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -43,8 +43,7 @@ main() { main if [ -z "${CMD_DB_URL:-""}" ] ; then - # TODO: support databases other than postgres and sqlite - export CMD_DB_URL="${postgres://$CMD_DB_USER:$CMD_DB_PASSWORD@$CMD_DB_HOST:5432/$CMD_DB_NAME}" + export CMD_DB_URL="${CMD_DB_TYPE}://$CMD_DB_USER:$CMD_DB_PASSWORD@$CMD_DB_HOST:5432/$CMD_DB_NAME}" fi # 3wc: `source /docker-entrypoint.sh -e` to load CMD_DB_URL for CLI scripts