Make DB configurable with environment variables

This commit is contained in:
Ivaylo Markov 2020-11-05 21:12:42 +02:00
parent c34955e106
commit 6bbd39dc23
1 changed files with 6 additions and 1 deletions

View File

@ -20,10 +20,15 @@ default: &default
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
database: <%= ENV.fetch("POSTGRES_DB") { "clarion" } %>
username: <%= ENV.fetch("POSTGRES_USER") { "clarion" } %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
host: <%= ENV.fetch("POSTGRES_HOST") { "localhost" } %>
port: <%= ENV.fetch("POSTGRES_PORT") { 5432 } %>
development:
<<: *default
database: clarion_development
database: <%= ENV.fetch("POSTGRES_DB") { "clarion_development" } %>
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.