Hugo and Nginx multi-stage build Dockerfile

After searching for a bit I was unable to find a nice pre-made Dockerfile to serve my personal site (built on top of Hugo), some of the images I found were only Hugo build steps, some others were able to serve and build the site but they pulled the FROM:ubuntu docker anti-pattern.

So here I’ll describe what I’m doing on my final Dockerfile, it’s a really simple Docker Multi-Stage build, the first step gets the Hugo binary and builds the site, the second one copies over the public folder of the built site and serves it using the official alpine Nginx image.

Read More