tmartin8080

tmartin8080

Elixir Phoenix 1.4 Deployments with Distillery and Edeliver on Ubuntu

I was having issues understanding how to deploy Phoenix applications, and decided to write an article on how I was eventually able to get it working with Distillery and Edeliver.

https://devato.com/automate-elixir-phoenix-1-4-deployment-with-distillery-and-edeliver-on-ubuntu/

Hopefully this helps somebody. Let me know if you have any issues, or suggestions on how to improve the article.

Thanks!

Most Liked

outlog

outlog

looks great from a quick scroll through.. good job :clap:

feedback:

  • I would strongly suggest using a package manager like asdf (or other) to install elixir and even node (to be able to maintain dev/staging/prod parity by installing very specific versions - and also to have elixir compiled against the used otp version)
  • Making nginx optional - eg showing how to run phoenix directly on port 80, would be a nice addition. + ssl maybe?

also check out @ziazek 's A Beginner's Guide To Deployment with Edeliver and Distillery - that has articles on automated DB backup - and ssl setup.. (maybe check if @ziazek has any good steps to perform that you might have missed..)

mythicalprogrammer

mythicalprogrammer

Suggestions:

For Step 4:

  1. The dependencies installation didn’t work unless you add the bionic universe repo iirc. I tinker around with many solution but I believe the one that work was adding the universe repo. Solution.
  2. For $5 droplet it only works if you create a swapspace (I set it via 4GB) and wait a bit for asdf to install and build erlang felt like 30 min. Source for problem. The solution.

For step Step 7:

  1. I think there’s a typo it should be sudo apt-get update
  2. I think you should cd ~ or make sure in home dir after su postgres otherwise it complains about making a directory in root
  3. typo pgsql should be psql
  4. Maybe add \q to quit psql but I’m being picky now.

I’m only on step 9… I’ll update this post later on if you like to hear more. Thank you for making this post.

A out of there suggestion would be using terraform or ansible for these configurations.

But I haven’t used or done dev ops in forever. Terraform is something I’ve been meaning to try out when I have time, I think it does what ansible does…

mythicalprogrammer

mythicalprogrammer

I’ll update the post with some of these finer details, and let me know if you have any more issues.

I just finished deploying with your tutorial (minus setting up nginx section).

I’ve encountered 3 4 issues.

  1. Another problem was I had to disable passphrase on my ssh key otherwise edelivery would throw error. I have no solution for this other than removing passphrase from my existing ssh key.

  2. Edeliver/Distillery fails with “bash: line 10: mix: command not found” error? With asdf installed I was getting the mix command not found error. I ended up using the third solution. The second solution give a good reason why I was encountering the problem.

  3. Another issue was ** (Mix) The task "release" could not be found. The reason turns out to be I didn’t commit to git master branch and I was in a branch. Solution and detail of problem.

  4. After deploying. I couldn’t figure out why I was getting server error. I figure out after a few minute that my db wasn’t built. After tinkering with config I realize I had to do. mix edeliver migrate production I skimed through the Admin commands section thinking that it wasn’t necessary.

Thanks again and have a great day.

Where Next?

Popular in Other Resources Top

New
ErlangSolutions
If anyone is interested in joining our next webinar with Bruce Tate :backhand_index_pointing_right:registration is now open! RSVP and lea...
New
ErlangSolutions
Join the team from the Massachusetts Bay Transportation Authority as they explore their work with Elixir from three unique perspectives. ...
New
ErlangSolutions
We’re excited to announce that Juliana Helena will be joining us on the webinar this month. She’ll be expanding on the talk she gave at ...
New
kpanic
Hi everyone, At the company where I work (Taxfix), we prepared an internal Elixir course for our folks. We decided to share it with eve...
New
Timtonix
A tous les français de la communauté Elixir, J’ai découvert hier ce livre traitant d’élixir Elixir - Un langage de programmation 100 %...
New
theodore
Hello, Like many people on Earth, I’ve been trying to understand the transformer architecture. I translated the Python code in https://w...
New
krishna_vaguelyright
Hi I am new to Elixir, just started learning 3 weeks back. I am building a Chat App with Elixir/Phoenix as backend & React-Native on ...
New
ErlangSolutions
Webinar announcement :loudspeaker: We’re kicking 2020 off with a live coding demonstration of how you can build Tetris in Elixir. It’s a ...
New
blackode
Elixir Quiz that tests your Knowledge in Elixir Programming. Elixir Functional Programming Test Intermediate level :pen: 30 questions ·...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement