amnu3387

amnu3387

Automating Server Provision for Edeliver/Distillery Releases

Hey,

so I’ve been getting down the server provisioning rabbit hole lately. Although I was happy creating images in AWS or whatever cloud platform that I could just re-use, I wanted to understand a bit more about this, plus the way releases work sometimes made it difficult to set up correctly the environment for building the release correctly. I looked at Ansible, Chef and Docker. I found out chef had a way to be run “locally” (or solo) in order to be more similar to ansible and useful for small rigs so I started exploring that.

This is the result of that exploration, a .sh script that packs your recipes and deploys them on a server instance running Ubuntu. Included are a bunch of recipes for:

  • provisioning a server ready to run a simple release packing phoenix, served behind a basic nginx conf (http only) with systemd
  • provision a postgresql database
  • provision certbot & automatic renewal of the certificates
  • provision a full https nginx configuration (to use with the certbot recipe)
  • provision a fully working build server with Erlang, Elixir, Node and Yarn and correctly setting up the environment for the build

After setting one environment file, you basically run it like this:
./deploy_kitchen.sh ubuntu@your_instance_address ‘recipe[elixir_web::default],recipe[elixir_web::postgresql],recipe[elixir_web::certbot],recipe[elixir_web::nginx]’

And you have a ready server to deploy your release, serving the app on https, etc.

You can find the full repo at GitHub - mnussbaumer/chef_local_elixir: A repository to automate build & production servers provisioning for elixir aimed at edeliver, distillery and phoenix · GitHub
Hope it’s useful for anyone looking to explore this topic

Where Next?

Popular in Guides/Tuts Top

smpallen99
Did you know that IO.inspect/2 returns the the first argument and accepts a label option as a second argument. This makes it a perfect to...
New
annad
I’m posting this for developers who are totally new to Phoenix like myself. This is all probably obvious to more skilled Phoenix develope...
New
voltone
The EEF’s Security WG has released the first public draft of the Secure Coding and Deployment Hardening Guidelines for BEAM languages. “...
New
New
f0rest8
Hi, TLDR: form attribute set on the input fields and button submit. I just wanted to share a solution I discovered when making live inl...
New
mudasobwa
The post covering how to generate nifty types to use in @spec in compile time with macros.
New
water
I’ll post this here, It might help someone in the future. Feedback is greatly appreciated. I use it with direnv on NixOS, It should wor...
New
jshprentz
Geoffrey Lessel’s 2019 book, Phoenix in Action, was written for Phoenix 1.4. I found that the book’s code examples did not match the cur...
New
ob1
Recently we partitioned a table with 28 million rows by its ULID to improve query speeds and reduce query timeouts. To do this I ended up...
New
dmitriid
This is not a question, but a post for anyone who may need it in the future. Sometimes some browsers may mangle the filename if it’s non-...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
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
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
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
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
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
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

We're in Beta

About us Mission Statement