Docker Compose for Jekyll Documentation Site

🚀 Quick Start (Apple Silicon Compatible)

Start the Jekyll server:

cd docs
docker compose up

Visit: http://localhost:4000

The server will automatically reload when you make changes to:

🛠️ Commands

Start Server (with live reload)

docker compose up

Start in Background

docker compose up -d

Stop Server

docker compose down

Rebuild and Start (after Gemfile changes)

docker compose down
docker compose up --build

View Logs

docker compose logs -f jekyll

Install Dependencies Only

docker compose run --rm jekyll bundle install

Clean Build Cache

docker compose run --rm jekyll bundle exec jekyll clean

📦 Apple Silicon Notes

This configuration is fully compatible with Apple Silicon (M1/M2/M3):

🔧 Customization

Change Port

Edit docker-compose.yml:

ports:
  - "8080:4000"  # Access at localhost:8080

Disable LiveReload

Edit command in docker-compose.yml:

command: jekyll serve --host 0.0.0.0

🐛 Troubleshooting

Port Already in Use

# Find and kill process on port 4000
lsof -ti:4000 | xargs kill -9

Gem Installation Errors

# Remove volume and rebuild
docker compose down -v
docker compose up

File Permission Issues

# Reset permissions (macOS)
sudo chown -R $(whoami) .

📝 Workflow

  1. Make changes to documentation files
  2. Jekyll auto-rebuilds (watch console output)
  3. Browser auto-reloads (if LiveReload enabled)
  4. View changes at http://localhost:4000

Optimized for macOS Apple Silicon