Last time we showed you how to deploy Phoenix application to Heroku. In this article we will show you how to host static website there.
Recently we wanted to setup a staging environment for one of our
Jekyll powered websites on Heroku.
It turns out, it’s easy to host Jekyll websites as
rack apps with the puma server - so we thought we’d share with you how to do it.
You need to add the following gems to your
rack-jekyll- for transforming your Jekyll app into a
rake- for generating pages during deploy (necessary because Heroku provides a read-only filesystem)
puma- for serving your
Procfile for declaring what commands are run on dynos, so we need one as well:
web: bundle exec puma -t 8:32 -w 3 -p $PORT
This basically will start
puma with 3 workers and 8-32 threads per worker.
You can find all the config options here.
Since we are going to run a
rack app we need
require ‘rack/jekyll’ require ‘yaml’ run Rack::Jekyll.new
Now are ready to deploy our app to Heroku:
git push heroku master
Simple, huh? If you have configuration issues that you would like us to handle, then let us take a look at your DevOps setup. We have helped many software companies in the USA and around the world with their systems configuration. Reach out to us at iRonin now!