Using Jekyll (in Docker) to run a local copy of the project website

A description of how to use Jekyll to serve this website on http://localhost:4000

Aug 30, 2026 • Seth Troisi • projectdoc

Introduction

Graham Higgins wrote a post in 2020 about running the site loccaly.

I haven’t done that because I hate Ruby.

Here are my notes on how I got it running in docker.

Run locally

# Commented out the install-if lines in the Gemfile
# Include both "tzinfo" and "tzinfo-data", remove "wdm"
sudo docker build -t prime-gaps .
sudo docker run --volume="$PWD:/srv/jekyll" -it prime-gaps bash
sudo docker run -p4000:4000 --volume="$PWD:/srv/jekyll" -it prime-gaps jekyll clean
sudo docker run -p4000:4000 --volume="$PWD:/srv/jekyll" -it prime-gaps jekyll build
sudo docker run -p4000:4000 --volume="$PWD:/srv/jekyll" -it prime-gaps jekyll serve --host 0.0.0.0 --incremental --livereload --trace

This seems to result in Jekyll running and serving on http://localhost:4000