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.

rasputin303

rasputin303

Thank you very much for writing this - it’s almost exactly what I’m planning to do once I get my app to a state where it’s worth deploying. When that happens (which may still be a few weeks away), I’ll give this a go and let you know how I get on.

tmartin8080

tmartin8080

Thanks @outlog! Very helpful feedback.

That’s a good point about the version manager. I was curious if something similar to Ruby’s rbenv existed.

The main reason I used Nginx was so you could add another application to the same server more easily.

Also, I later adding SSL with letsencrypt via Nginx and it was pretty straightforward, so I’ll be updating the article with this new step soon.

I’ll check out the other article as well, thanks again.

Where Next?

Popular in Other Resources Top

New
mkunikow
Microsoft: DEVOPS200.9x Architecting Distributed Cloud Applications Note: This course is not related to Elixir at all, but I found it ver...
New
ErlangSolutions
We’ve announced our latest webinar with Fred Hebert entitled ‘Testing Erlang and Elixir through PropEr Modelling’. There are a ton of tec...
New
maz
https://www.reddit.com/r/elixir/comments/f8by3w/im_connecting_a_godot_game_client_to_an_elixir
New
zkessin
I have a new free email course on how to best use types in Erlang and Elixir you can sign up here https://elixirtraining.org/types_cours...
New
arrowsmith
Hi everyone! (Sorry if this isn’t the right place to post this; admins, do what you must.) My name is George Arrowsmith and I’m happy to...
New
georgeguimaraes
I decided to use the “Awesome <…>” template to gather some links to libraries and talks related to Machine Learning in Elixir. I s...
New
danschultzer
TLDR This repo got all Terraform IaC files to setup AWS ECS for Elixir apps that includes web server(s) and database. It includes auto d...
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
PJUllrich
I’m happy to announce RunElixir.com, a free online guide to Elixir. It aims to answer the questions: How can I get started with Elixir?, ...
New

Other popular topics Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
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
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement