So I decided it might be worth to open source the entire thing, if only to save others some of the frustration I felt. I named the project "Railway"and here's what you get:
1 - Create a custom AMI with everything a Rails app need; 2 - Create a staging environment with webservers, workers, cache and job redis instances, postgres database and support for up to 9 branches of your app at the same time; 3 - Create a production environment with load balanced webservers, workers, cache and job redis instances, postgres database with a read replica; 4 - Deploy to staging; 5 - Deploy to production using rolling restarts; 6 - Update production servers to get the latest security updates; 7 - Upgrade production servers to a new AMI with zero downtime; 8 - Compile ImageMagick and Libvips from source in order to get more up to date versions than what is available in Ubuntu's repositories.
As you can imagine this is not an easy project to use. That’s why I included guides for instaling, running everything for the first time, customizing for your own app and the day to day workflow.
I hope this is useful for people who have considered moving from a PaaS to a IaaS before, but didn’t know where to start.
Link: https://github.com/FestaLab/railway