From bd95492d795e1576dcd1383e47afc1a493464a23 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 7 Mar 2023 15:16:45 +0100 Subject: [PATCH] fix: set postgres password from secret for app container --- compose.yml | 4 +++- entrypoint.sh.tmpl | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/compose.yml b/compose.yml index b7a5be3..c3f9235 100644 --- a/compose.yml +++ b/compose.yml @@ -12,8 +12,10 @@ services: secrets: - secret_key - smtp_pwd + - db_password environment: - - DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db + - POSTGRES_PASSWORD_FILE=/run/secrets/db_password + - DATABASE=rallly_db:5432/db - NEXT_PUBLIC_BASE_URL=${DOMAIN} - SECRET_PASSWORD_FILE=/run/secrets/secret_key - SUPPORT_EMAIL diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 4e6eb25..365c18f 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -25,5 +25,8 @@ file_env() { file_env "SECRET_PASSWORD" file_env "SMTP_PWD" +file_env "POSTGRES_PASSWORD" + +export DATABASE_URL=postgres://postgres:$POSTGRES_PASSWORD@$DATABASE /app/docker-start.sh