Can't run Phoenix using docker-compose

Unfortunately it’s not a default.

It was introduced in Elixir 1.11 to solve the configuration issues that have plagued Elixir since the begin.

Think of this file not as runtime but instead as a boot time configuration file, because contrary to what the name runtime implies it doesn’t allow to change configuration while your app is running, but it allows you to change configuration every time you boot your app.

In my apps I move all configuration to this file as much as possible. Check the official docs here:

To enable runtime configuration in your release, all you need to do is to create a file named config/runtime.exs:

import Config
config :my_app, :secret_key, System.fetch_env!("MY_APP_SECRET_KEY")

Secrets in Releases

For example prod.secret.exs isn’t secure to use, because now you have your production secrets inside the release binary and production secrets MUST BE only present in the server running the app, otherwise you risk to leak the secrets in all the places were the release binary is handled. It’s easy to reverse engineer a binary and extract those secrets.

Always require your secrets in runtime.exs with the use of environment variables. This approach will keep your production secrets outside the release binary that you have built somewhere else.