Skip to content

Documentation missing on how to add additional runtime config #14533

Closed
@ponychicken

Description

@ponychicken

Elixir and Erlang/OTP versions

Elixir 1.18.3 (compiled with Erlang/OTP 27)

Operating system

Debian

Current behavior

User story:
We have an Elixir app that is deployed with the Docker file created by mix.
The users should be able to provide a more complex configuration than is possible just with loading ENVs.
One option would be to ask them to create a copy of runtime.exs and overlay it, but it would contain a lot of unrelated config that they should not modify.

In the docs for config and releases it is mentioned, "If you want to (..) any sort of external configuration, this is the appropriate place to do so." But in contradiction of this actually calling load_config inside runtime.exs is forbidden.

Suggestion:
In the Docs add some info how additional config files which are evaluated at runtime can be defined in an Elixir project. I can do the PR but would need a pointer on how to actually achieve it. Adding something like the below neither throws an error, nor has any effect.

  def project do
    [
      app: :app_name,
      elixir: "~> 1.14",
      config_providers: [{Config.Reader, "additional_config.exs"}],

Expected behavior

see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions