From 674cbd043188787be88bc06e194c3cba9b7c9856 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 24 Feb 2025 12:32:54 -0500 Subject: [PATCH] Fix CMD_DB_URL setting for postgres --- abra.sh | 2 +- compose.postgresql.yml | 2 +- entrypoint.sh.tmpl | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/abra.sh b/abra.sh index a26aebe..edf3403 100644 --- a/abra.sh +++ b/abra.sh @@ -1,2 +1,2 @@ -export ENTRYPOINT_CONF_VERSION=v10 +export ENTRYPOINT_CONF_VERSION=v11 export PG_BACKUP_VERSION=v1 diff --git a/compose.postgresql.yml b/compose.postgresql.yml index 6fc8ee5..71d87b2 100644 --- a/compose.postgresql.yml +++ b/compose.postgresql.yml @@ -2,7 +2,7 @@ version: "3.8" services: app: environment: - - CMD_DB_URL= + - POSTGRES_ENABLED=1 - CMD_DB_NAME=codimd - CMD_DB_USER=codimd - CMD_DB_HOST=db diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 960b23a..da23531 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -40,7 +40,9 @@ main() { main -export CMD_DB_URL="${CMD_DB_URL:-postgres://$CMD_DB_USER:$CMD_DB_PASSWORD@$CMD_DB_HOST:5432/$CMD_DB_NAME}" +if [ -n "$POSTGRES_ENABLED" ]; then +export CMD_DB_URL="postgres://$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 if [ ! "${1-}" == "-e" ]; then