axelson

axelson

Scenic Core Team

Elixir Blog Post: Tips for Improving Your Elixir Configuration

I talk about how I really like to use runtime configuration and discuss some common pitfalls of configuration in Elixir.

Most Liked

donghyun

donghyun

This post is so helpful! Thanks a lot!

Especially I like the last part about using Code.require_file/2. But I tried that and found it doesn’t work in my release app. It is due to the second parameter of Code.require_file/2 which is the relative file path. In my Dockerfile I copy only release output(under _build/prod/rel/) to my workdir, though there is no config/ directory. So I change the file path like that:

case config_env() do
  :prod -> Code.require_file("runtime.prod.exs", __ENV__.file |> Path.dirname())
end

Then it works well. Anyway, thanks for the great post again!

Samuel-88

Samuel-88

Lots of great info I had no idea about! Thanks for sharing!

Where Next?

Popular in Blog Posts Top

New
thiagoa
Hello everyone, I published the first post of a series which aims to TDD a full application under an Umbrella project. Each post will g...
New
jordiee
https://medium.com/@jpiepkow/distributed-state-is-hard-5a0d384c2f3c
New
marcelo
Long story short, over the past years we’ve been scaling our operation quite a lot at Unbabel. Most of our codebase is Python and some of...
New
axelson
I talk about how I really like to use runtime configuration and discuss some common pitfalls of configuration in Elixir.
New
zachdaniel
In this post I explore the silos that exist in the Elixir ecosystem, the pros and cons, and what we can improve.
New
New
AstonJ
Update: How to use the blogs section You can post in one of the Official Blog Posts threads (like this one), or, via Devtalk and a new t...
New
Paradox
Testing is an important part of any modern piece of software. But writing tests can quickly become an exercise in frustration, with tons ...
New
paulanthonywilson
This is an overview of different ways to try and kill an OTP process (in Elixir) and the behaviour to expect when that happens. I know th...
New

Other popular topics Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement