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:

  1. I needed to install hex and rebar first in order to install mixed dependencies
  2. I used an exrm library to generate the release. So don’t forget to add this to the dependencies list.
  3. As entry point I use binary that was generated during the release procedure.

Simple as that! Enjoy Elixir and Docker.

A single golf clap? Or a long standing ovation?

By clapping more or less, you can signal to us which stories really stand out.