pillaiindu

pillaiindu

OK, I created a Phoenix application (after reading numerous books), now how do I deploy it?

Note: Please read the question and details, and think about it before reading any of the replies.

There are numerous resources (books, video tutorials/courses, blog-posts etc) which will teach a complete noob how to create a web application based on Phoenix from start to finish, but there is no single resource which will teach her to deploy that same application (in a way as if it’s taught to a 5 / 6 years old).

I had high hopes from the book Designing Elixir Systems with OTP, but when I read its contents, it doesn’t teach how to actually deploy the SCALABLE application you created after reading that book, and I think nobody designs a SCALABLE application just to keep it in her harddisk and brag about it in front of her friends.

Is there any book which will teach me how to deploy an Elixir / Phoenix application in a way as if Jose or Chris is deploying himself or someone from Plataformatec or DockYard in the best scalable way on a group of bare-metal servers rented at Hetzner or a cluster of VPS instances from DO, Linode (again) Hetzner or other cheap (but reliable) host?
I checked Rails community have some nice books (and some dedicated coruses) on this topic which teaches a noob how to deploy a Rails application to a VPS (with and without Docker/Kubernetes etc) she just created.

Most Liked

lukebakken

lukebakken

My co-worker Gerhard put together the following - The new changelog.com setup for 2019

It goes into great detail about how changelog.com is deployed. The entire deployment code is open-source as well.

idi527

idi527

There have been several ElixirConf talks about this which would probably answer most of your questions … I like this one in particular: Tian Chen - Release, Deploy, Monitor and Upgrade Elixir Services in Real World - Code BEAM SF 2018

LostKobrakai

LostKobrakai

There are two parts to deployment.

  1. Bundle the data needed to be pushed to your servers
    In Elixir/Erlang usually you build an otp release to be deployed. There is documentation for mix release in elixir 1.9 and also quite a bunch of documentation around distillery. In erlang I’m not sure which tool would create the release, but it’s a similar process.
  2. Getting said data to the server and running it on there.
    This part is actually hardly specific to elixir/erlang at all, there are a few requirements to releases (same architecture/os/native libraries where the release is build and deployed), but other than that it can be as simple as sftp’ing the release to the server or wrapping it in a docker file and using k8s to move it to the servers it should run on. Starting the release is actually just calling a binary with a command of how you’d like to run the release (daemonized vs in foreground). Those commands are also well documented.
  3. (Extra)
    Erlang Clustering: You can find a chapter on how it works in Designing for Scalability with Erlang/OTP. There’s also something in the erlang documentation itself. How you configure clusters depends quite a bit on how you manage servers and how dynamic/static your clusters are/should be.
    Mnesia: If you use mnesia the above afaik becomes more tricky as mnesia is said to be not well suited for nodes joining/leaving often.
    Other external dependencies to run: Look for “How to deploy external dependency

I hope the above makes the point clear that when it comes to deployment a good chunk is not really about ruby or elixir or go, but about “do we buy a few bare metal servers and configure everything statically” or “we manage k8s clusters of 1000 nodes”; “Do we use CI/CD or deploy from developer machines?”. I’m not aware of books specifically for elixir (yet), but you should be able to read e.g. a generic “this is how you do CI/CD” book and adapt it to how elixir fit’s into the picture.

Also if you could specify which of the above topics you have most problems with people can also be more precise in suggesting reading material on the topic.

Where Next?

Popular in Questions Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54120 245
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement