Fix CMD_DB_URL setting for postgres

This commit is contained in:
3wc 2025-02-24 12:32:54 -05:00
parent 4972af78e8
commit 674cbd0431
3 changed files with 5 additions and 3 deletions

View File

@ -1,2 +1,2 @@
export ENTRYPOINT_CONF_VERSION=v10
export ENTRYPOINT_CONF_VERSION=v11
export PG_BACKUP_VERSION=v1

View File

@ -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

View File

@ -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