Mix release and config files priority

I have a clear defined precedence in my setup, because my releases.exs file is always evaluated first, no matter what env I am working on, therefore I override production config in development, not the other way around. See my reply with an example here:

config.exs

# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.

# General application configuration
use Mix.Config

# Keep consistency between environments. Development will derive from a
#  production environment, not the other way around. Having separated
#  configuration as Elixir and Phoenix currently promote can lead to adding a
#  new configuration field in `dev.exs` that you then forgot to add in
#  `prod.exs` and/or `releases.exs`, therefore you then have a broken production
#  deployment.
import_config "releases.exs"

config :mnesia,
  dir: '.mnesia/#{Mix.env}/#{node()}'

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
1 Like