David Kimura PRO said 5 months ago on Kamal Kitchen Sink :
This is what it looks like in the episode. You could also have an environment variable for the database URL and use that too instead of providing the username, password, host and port individually. 

default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # https://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  <% if ENV["DB_HOST"] %>
  host: <%= ENV["DB_HOST"] %>
  username: postgres
  password: postgres
  <% end %>

...

production:
  primary: &primary_production
    <<: *default
    database: example_production
    username: example
    host: 192.168.1.117
    password: <%= Rails.application.credentials.dig(:postgres, :password) %>
  cache:
    <<: *primary_production
    database: example_production_cache
    migrations_paths: db/cache_migrate
  queue:
    <<: *primary_production
    database: example_production_queue
    migrations_paths: db/queue_migrate
  cable:
    <<: *primary_production
    database: example_production_cable
    migrations_paths: db/cable_migrate