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