require "dry-configurable" module BlogBackend extend Dry::Configurable setting :postgres do setting :database setting :host setting :password setting :username end setting :redis do setting :uri end end BlogBackend.configure do |config| config.postgres.database = ENV.fetch("POSTGRES_NAME") { "ewallet_backend" } config.postgres.host = ENV.fetch("POSTGRES_HOST") config.postgres.password = ENV.fetch("POSTGRES_PASSWORD") config.postgres.username = ENV.fetch("POSTGRES_USERNAME") config.redis.uri = ENV.fetch("REDIS_URI") end