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

egze
I was preparing to deploy a production application to AWS Fargate, and to practice I wanted to play with DNS polling and node discovery o...
New
zenw0lf
Hello all! For those wanting to try your hands at Elixir / Phoenix, I wrote a comprehensive tutorial on doing a simple JSON API with sai...
New
hauleth
Some time ago someone suggested me to write article about how I have configured my Vim to work with Elixir, now there it is: https://med...
New
niku
I write an article Parameterized testing with ExUnit.The key concept is using ExUnit.Case.register_test/4 such as ExUnit.start() defmod...
New
dkuhlman
For those of you who might be interested in using ZeroMQ in Elixir, I converted the Erlang examples in the ZeroMQ “zguide” to Elixir. I ...
New
New
AstonJ
This was originally posted on my blog, but since my I’ve taken it down (I hadn’t posted anything on it for a while and since it was runni...
New
magnetic
Hey :waving_hand:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and ...
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
kevinlang
Hey all, With Phoenix 1.6 just around the corner, I figured I’d make a tutorial on how to add Bulma to a new Phoenix 1.6 project. By lev...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
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
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
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
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement