Hello everyone !
I’m new to the forum, even if I used it a lot when learning Elixir I never had the need to ask my own questions. I always found my answers there but not this time. That’s why I’m writing my first post
Here is the context: I have an Elixir application that I have always used by launching it via the command iex -S mix phx.server
.
This app is an Umbrella app. Until now I had shared the configuration files between the different apps.
Recently I wanted to try switching to mix release with the Docker option. I had a lot of modifications to make but I finally managed to get my app working. I just have a few libraries that don’t work correctly because they use things not allowed in mix release but these are for “bonus” uses, let’s say.
However, I am not satisfied at the moment with what I have done. I copied/pasted all the contents of my config.exs, prod.exs and prod.secret.exs files into the runtime file. Then in my Dockerfile I copied only this file with a custom config.exs file which contains very little config.
My runtime file is currently 1500 lines long because it contains the configs of all my applications.
Is there another way to do it that is cleaner?
In fact I would like to be able to make my code coexist so that it is able to run my application both with iex -S mix
and mix release
.
What are the best practices regarding configs for an Umbrella application that must be able to work in both modes?
I’ve read a lot of different things about this, some delete app config files, others keep them so I’m not sure what the best method is.
NB: If I copy all my config files in the Dockerfile I need a ton of environment variables that are not accessible at build time (and therefore require the use of a secret file). This is why I created a configs file which only contains the minimum for compilation and which is only used for the mix release
.
I thank all the people who will answer me and those who have already given me so many answers in the past