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
looks great from a quick scroll through.. good job ![]()
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
Suggestions:
For Step 4:
- 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.
- 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:
- I think there’s a typo it should be
sudo apt-get update - I think you should
cd ~or make sure in home dir aftersu postgresotherwise it complains about making a directory in root - typo
pgsqlshould bepsql - Maybe add
\qto 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
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.
-
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.
-
Edeliver/Distillery fails with “bash: line 10: mix: command not found” error? With asdf installed I was getting the
mix command not founderror. I ended up using the third solution. The second solution give a good reason why I was encountering the problem. -
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. -
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 productionI skimed through the Admin commands section thinking that it wasn’t necessary.
Thanks again and have a great day.
Popular in Other Resources
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









