Docker Dev Environment

This project includes Docker configuration for local development with live preview and automatic reloading.

Prerequisites

Getting Started

  1. 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_gems named 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
    
  2. Access the site: Open your browser and navigate to:
    http://localhost:4000
    
  3. Live reload: The site automatically reloads in your browser whenever you save changes to files. No manual refresh needed.

  4. Stop the development server: Press Ctrl+C in the terminal, or run:
    docker-compose down
    

Troubleshooting

Testing GitHub Pages Compatibility

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:

  1. Build without LiveReload:
    docker-compose exec jekyll bundle exec jekyll build --strict_front_matter
    
  2. Verify the _site folder is generated correctly without errors.

  3. Before pushing to GitHub, you can disable LiveReload by removing the --livereload flag from the docker-compose.yml or Dockerfile command.