Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.15 KB

README.md

File metadata and controls

27 lines (19 loc) · 1.15 KB

Elixir server docker

Docker configuration for running an Elixir server

Running your Elixir server

docker run --name my-elixir-server \
    -v /path/to/mix/folder:/app \
    -d madnificent/elixir-server

What it does

This will get all dependencies, compile them and run a production-build of your server with mix server.

The commands boild down to:

MIX_ENV=prod mix do deps.get, compile
MIX_ENV=prod mix compile.protocols
MIX_ENV=prod elixir -pa _build/prod/consolidated -S mix run --no-halt

Optional configuration

You can set the following arguments:

  • IEX_COOKIE sets the default cookie for connecting
  • IEX_NAME sets the name for connecting (@ip will be replaced by the docker's ip address)
  • IEX_PORT forces running the node on a particular port (eg: 9000)
  • LOG_ELIXIR_STARTUP_COMMAND Logs the command by which the service will be booted up and the IP address of the container when non-empty (handy for connecting to the node)

The combination of these allows you to connect another erlang node to this one. See http://benjamintan.io/blog/2014/05/25/connecting-elixir-nodes-on-the-same-lan/