Skip to content

redpencilio/elixir-server-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

Docker configuration for running an elixir server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 79.7%
  • Dockerfile 20.3%