Question about _build an binaries for different envs

Hi there,

I hope this is something that wasn’t asked thousand times before, but could’t find an answer for that:

In the _build folder in my elixir/phoenix app I have the builds for the different environments.
My question is: why do I need the binaries for different envs? I control most of my setup with environment vars (12 factor app) so more or less all of my configuration is in the root config file anyways (except the test - env).

Is it possible to have only one binary folder or does it make sense to split them up? The reason I ask is: I run the app in docker and start it in dev (locally) or prod (on production) and don’t want it to compile on the fly.


1 Like

The compiled code gets compiled differently in different environments as macro’s can generate differently, different settings, debug info is enabled or not, etc… etc… :slight_smile:

You only need it for the environment that you are actively using though. :slight_smile:

If you want to deploy it in docker, look in to distillary, it is a release manager to minimize and pack it up for release just for things like docker. :slight_smile:

1 Like

Thx for the explanation. That makes sense!