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 https://github.com/mnussbaumer/chef_local_elixir
Hope it’s useful for anyone looking to explore this topic

Where Next?

Popular in Guides/Tuts Top

mhanberg
Hi! I recently finished adding authentication to my Phoenix API, so I wanted to share what I learned. I haven't created authentication ...
New
dkuku
I Created a blog post about setting up svelte with phoenix. I found it a bit tricky and the only blog post I found was written using som...
New
njwest
In the process of developing a Phx-based multiplayer experience, I found myself with so many browser tabs open with Elixir gaming resourc...
New
fuelen
Hi all! Just want to share a small code snippet which allows writing CASE expressions using macro which is similar to cond. Here is an ...
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
marcin
This post is intended to be a guide for others, I was running a remote debugger for the first time and appreciate feedback on how I could...
New
KoviRobi
Hi, I’ve written the following to debug function calls, not sure if it’s useful for anyone else, and if so should I put it somewhere? i...
New
nietaki
Just a quick heads up: There seems to be a bug in Erlang/OTP 21.3, which can cause some errors when making http requests. If you’re using...
New
mudasobwa
The post covering how to generate nifty types to use in @spec in compile time with macros. https://rocket-science.ru/hacking/2020/07/15/...
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

jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
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
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
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
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
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement