This project includes Docker configuration for local development with live preview and automatic reloading.
- Docker and Docker Compose installed on your system
-
Start the development server:
docker-compose up --build
On the first run, Docker will build the image and install all Ruby gems into the
jekyll_gemsnamed volume (2–3 minutes). Subsequent runs will start instantly.NB - if you are using colima and you don't have it as a background service:
/opt/homebrew/opt/colima/bin/colima start -f
or
colima start
-
Access the site: Open your browser and navigate to:
http://localhost:4000 -
Live reload: The site automatically reloads in your browser whenever you save changes to files. No manual refresh needed.
-
Stop the development server: Press
Ctrl+Cin the terminal, or run:docker-compose down
- Port already in use: If port 4000 or 35729 is already in use, modify the port mappings in
docker-compose.yml. - Gems not updating: The named volume
jekyll_gemspersists across runs. To reinstall gems, run:docker-compose down -v docker-compose up
- Slow file detection: On macOS, Docker Desktop's volume mounts may have latency. For faster reload detection, consider using native mounts or increasing polling timeout in Jekyll config.
The development environment includes jekyll-livereload for live reloading, which is not part of the official github-pages gem. To ensure your site builds correctly for GitHub Pages deployment:
-
Build without LiveReload:
docker-compose exec jekyll bundle exec jekyll build --strict_front_matter
-
Verify the
_sitefolder is generated correctly without errors. -
Before pushing to GitHub, you can disable LiveReload by removing the
--livereloadflag from the docker-compose.yml or Dockerfile command.