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
Popular in Guides/Tuts
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
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









