Hosting Grav on Heroku
10, Apr 2016When I had to host a little web app with RabbitMQ and PostgreSQL some years ago I met Heroku for the first time. Heroku is a PaaS which makes a developer's life much easier, as it allows to focus on development instead of setting up and managing servers and infrastructure.
Another thing that's great with Heroku is, that it makes you a better software developer because it enforces you to work according to the twelve factor app methodology.
Using Heroku for hosting a Grav website has a massive disadvantage: Heroku is a flat file CMS, meaning all pages, all users, all visitor logs etc. - everything - is stored on the file system, which conflicts with the twelve factor app rule of stateless processes. The consequence is, that you should neither manage the contents of your Grav's CMS online at Heroku nor could you rely on the logs collected by Grav.
Today I've taken a first look at Terraform and Ansible. I've used Terraform to configure an infrastructure consisting of three NGINX reverse proxies behind a load balancer forwarding incoming requests to a small Node.js app on Google Compute Engine. If you like to, check out the notes I've taken or use the final code on GitHub.