O'Reilly logo

Adopting Elixir by Jose Valim, Bruce Tate, Ben Marx

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deploying with Mix

The emergence of deployment tools within git and Elixir’s basic tooling makes it pretty simple to stand up a dead-simple deployment strategy for a single machine. The easiest way to run an Elixir application in production is by fetching or pushing the source code to your servers and calling:

 $ ​​MIX_ENV=prod​​ ​​mix​​ ​​run​​ ​​--no-halt

mix run will compile and start the current application and all of its dependencies. --no-halt guarantees Elixir won’t terminate just after the application is booted. Phoenix is similar. Instead of mix run --no-halt, you will execute mix phx.server, still setting the Mix environment to “prod”.

MIX_ENV=prod ensures your application is running in the production environment with the relevant ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required