Static site hosting on Dokku and Deis

Deis and Dokku, the open source Heroku-like PaaS, can be used for hosting static sites too. Since they both support Dockerfile based deployments all we need is an Docker Image with Nginx.

I created giorgos/dokku-static-site which uses the ONBUILD instruction. To use it create a Dockerfile at the root directory of your static site with only one line:

FROM giorgos/dokku-static-site

and then place all your files under the html directory. If moving your website files to another directory isn't in your plans, you can alternatively create a symbolic link

ln -s . html

Then push to your Deis / Dokku server as usual and it will download the image and do the rest.

git push dokku master

The image works nicely with Dokku's letencrypt plugin too, no need to worry about ports or custom Nginx configurations.

giorgos/dokku-static-site is based on debian:stable and a cron job will trigger a rebuild every hour to always be up-to-date with latest security patches.

You can find more information about Deis Dockerfile Deployments and Dokku Dockerfile Deployments in each project's documentation.

Go Top