DevContainer Configuration
By Amr
VS Code Dev Container configuration for one-click cloud and local development environments — GitHub Codespaces, JetBrains Gateway, and VS Code with the Jekyll toolchain pre-installed.
Estimated reading time: 2 minutes
Table of Contents
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
The container is based on mcr.microsoft.com/devcontainers/jekyll:2-bullseye and adds:
| Tool | Source |
|---|---|
| Jekyll + Bundler | Base image |
| Docker-in-Docker | devcontainers/features/docker-in-docker:2 |
GitHub CLI (gh) |
devcontainers/features/github-cli:1 |
| Node.js LTS | devcontainers/features/node:1 |
Post-Create Hook
bundle install --jobs 4 --retry 3
Runs automatically after the container is created to install all gem dependencies.
Post-Start Hook
bundle exec jekyll serve \
--config '_config.yml,_config_dev.yml' \
--host 0.0.0.0 --port 4000 --livereload
The Jekyll dev server starts automatically every time the container starts. 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 highlightingyzhang.markdown-all-in-one— Markdown editingDavidAnson.vscode-markdownlint— Markdown lintingstreetsidesoftware.code-spell-checker— Spell checkesbenp.prettier-vscode— Code formattingms-azuretools.vscode-docker— Docker management
Using the DevContainer Locally
If you have Docker Desktop installed, you can use the devcontainer without Codespaces:
- Install the VS Code Dev Containers extension
- Open the repo folder in VS Code
- Click the notification to Reopen in Container (or use the Command Palette → Dev Containers: Reopen in Container)
- Wait for the container to build (~2–3 minutes on first run)
- 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.
Related
See also
- [[Development]]
- [[Docker]]
- [[Getting Started]]