Elixir in Docker
by Sergey Gernyak, RoR developer at Brain.
Some time ago I was working on a some small project with one of my teammates. I was writing a small API layer in Elixir. That small Elixir application had several dependencies: 1. database (we chose Postgres) and 2. some config for nginx. We decided to use docker on the server to setup all needed dependencies as well as the application itself.
Here is the Dockerfile we created:
That config has some very specific entries. Let me explain my process:
- I needed to install hex and rebar first in order to install mixed dependencies
- I used an exrm library to generate the release. So don’t forget to add this to the dependencies list.
- As entry point I use binary that was generated during the release procedure.
Simple as that! Enjoy Elixir and Docker.