Skip to Main Content
Mastering Elixir
book

Mastering Elixir

by André Albuquerque, Daniel Caixinha
July 2018
Intermediate to advanced content levelIntermediate to advanced
574 pages
14h 7m
English
Packt Publishing
Content preview from Mastering Elixir

Connecting to a containerized node

Before we connect to the node, we have to expose the container ports that will be used to connect the nodes. Edit your docker-compose.dev.yml file and add the following:

$ cat docker-compose.dev.yml  # ...  app:    image: elixir_drip:dev    # ...    ports:      - 4000:4000
      - 4369      - 9001-9004    # ...

The 9001-9004 port range is the range on which EPMD will assign ports to new nodes. We will tell EPMD to respect this range by passing the inet_dist_listen_min and inet_dist_listen_max parameters when running Elixir, and also when starting the application release. To pass these parameters when running the release, we need to set the erl_opts option in the release configuration:

$ cat rel/config.exs  # ...environment :prod ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781788472678Supplemental Content