Skip to content

DevContainer Configuration

zer0-mistakes ships a .devcontainer/devcontainer.json that lets you open a fully configured Jekyll development environment with a single click β€” no local Ruby, Bundler, or Node installation required.

Supported Environments

Environment How to open
GitHub Codespaces Click Code β†’ Codespaces β†’ Create codespace on main
VS Code Dev Containers Open the repo folder β†’ Reopen in Container
JetBrains Gateway Connect to Codespace or remote Docker host

Configuration File

.devcontainer/devcontainer.json

What's Pre-Installed

Instead of pulling a generic base image and installing gems on every launch, the devcontainer builds from the repo's own docker/Dockerfile (the dev-test stage). That stage runs bundle install at image-build time, so the whole Jekyll toolchain is preloaded into the image β€” the gems always match the checked-out branch's Gemfile.lock, and there's no slow bundle install on first boot.

Tool Source
Ruby 3.3 + Bundler + Jekyll toolchain docker/Dockerfile dev-test stage (gems baked in)
GitHub CLI (gh) devcontainers/features/github-cli:1

Docker-in-Docker and a standalone Node install are intentionally not included β€” they aren't needed to render the site (Playwright/Sass run on the host), and dropping them keeps Codespace creation and prebuilds fast.

Near-instant launch with prebuilds

Because the image is self-contained, GitHub Codespaces prebuilds can build it ahead of time so new Codespaces restore from a ready image in seconds. Enable it under Settings β†’ Codespaces β†’ Set up prebuild (target main, trigger On configuration change). See .devcontainer/README.md.

Post-Create Hook

git config --global --add safe.directory ${containerWorkspaceFolder} && (bundle check || bundle install --jobs 4 --retry 3)

bundle check is a fast no-op when the gems are already baked into the image; it only falls back to a full install if the lockfile drifted.

Post-Start Hook

bundle exec jekyll serve \
  --config '_config.yml,_config_dev.yml' \
  --host 0.0.0.0 --port 4000 --livereload --force_polling

The Jekyll dev server starts automatically every time the container starts (nohup keeps it alive after the hook returns; --force_polling makes file watching reliable over the Codespaces bind mount; logs land in /tmp/jekyll-serve.log). The site is available at http://localhost:4000 and forwarded automatically in VS Code and Codespaces.

Forwarded Ports

Port Service
4000 Jekyll site (auto-opens in browser)
35729 LiveReload (silent)

VS Code Extensions

The configuration recommends these extensions:

  • sissel.shopify-liquid β€” Liquid template syntax highlighting
  • yzhang.markdown-all-in-one β€” Markdown editing
  • DavidAnson.vscode-markdownlint β€” Markdown linting
  • streetsidesoftware.code-spell-checker β€” Spell check
  • esbenp.prettier-vscode β€” Code formatting
  • ms-azuretools.vscode-docker β€” Docker management

Using the DevContainer Locally

If you have Docker Desktop installed, you can use the devcontainer without Codespaces:

  1. Install the VS Code Dev Containers extension
  2. Open the repo folder in VS Code
  3. Click the notification to Reopen in Container (or use the Command Palette β†’ Dev Containers: Reopen in Container)
  4. Wait for the container to build (~2–3 minutes on first run)
  5. The site starts automatically at port 4000

Relationship to Docker Compose

The devcontainer and docker-compose.yml serve different purposes:

devcontainer.json docker-compose.yml
VS Code / Codespaces IDE integration Team-wide dev server + multi-service stack
Extension recommendations, settings sync Production-parity environment
Auto-start Jekyll on container start Explicit docker-compose up required

You can use either (or both) depending on your workflow.

See also