From 2ede8e047990d07dc8c7b1285ec7df269d31a464 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Mon, 21 Oct 2019 09:32:02 +0200 Subject: [PATCH] feat: add the possibility to override the DATABASE_URL by setting it in the environment --- .../compose/production/django/entrypoint | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint index 0a76b3107..9356e7975 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint +++ b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint @@ -14,7 +14,10 @@ if [ -z "${POSTGRES_USER}" ]; then base_postgres_image_default_user='postgres' export POSTGRES_USER="${base_postgres_image_default_user}" fi -export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" + +if [ -z ${DATABASE_URL+x} ]; then + export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" +fi postgres_ready() { python << END