chore: add GitHub Codespaces devcontainer configuration#2
Conversation
Agent-Logs-Url: https://github.com/bytenomad23/hyperframes/sessions/5e10f88f-a8be-4af1-848c-f18b1fe25963 Co-authored-by: bytenomad23 <209907175+bytenomad23@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Codespaces / devcontainer setup to standardize local development by packaging system dependencies (Chromium/FFmpeg/fonts) plus Node.js + Bun inside a container.
Changes:
- Introduces
.devcontainer/Dockerfileto install rendering/system dependencies, Node.js 22, and Bun, and to set Puppeteer-related env vars. - Adds
.devcontainer/devcontainer.jsonwith VS Code extensions/settings, lifecycle hooks (bun install,bun run build), and port forwarding for the Studio dev server.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.devcontainer/devcontainer.json |
Configures the devcontainer experience (extensions, editor settings, lifecycle commands, forwarded ports). |
.devcontainer/Dockerfile |
Defines the container image with system deps + Node/Bun and Puppeteer/Chromium environment configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN curl -fsSL https://bun.sh/install | bash | ||
| ENV PATH="/root/.bun/bin:/home/vscode/.bun/bin:$PATH" | ||
|
|
||
| # Install bun for the vscode user as well | ||
| RUN su vscode -c "curl -fsSL https://bun.sh/install | bash" \ | ||
| && su vscode -c "~/.bun/bin/bun --version" \ | ||
| && echo "bun installed for vscode user" |
There was a problem hiding this comment.
The Bun install step doesn’t actually enforce a specific Bun version: ~/.bun/bin/bun --version only prints the version, and there’s no pinned version/expected value. For reproducible devcontainers, consider pinning Bun via an env var/arg (or BUN_VERSION) and failing the build if the installed version doesn’t match.
| RUN curl -fsSL https://bun.sh/install | bash | |
| ENV PATH="/root/.bun/bin:/home/vscode/.bun/bin:$PATH" | |
| # Install bun for the vscode user as well | |
| RUN su vscode -c "curl -fsSL https://bun.sh/install | bash" \ | |
| && su vscode -c "~/.bun/bin/bun --version" \ | |
| && echo "bun installed for vscode user" | |
| ARG BUN_VERSION=1.1.38 | |
| RUN curl -fsSL https://bun.sh/install | bash -s -- bun-v${BUN_VERSION} \ | |
| && test "$(/root/.bun/bin/bun --version)" = "${BUN_VERSION}" | |
| ENV PATH="/root/.bun/bin:/home/vscode/.bun/bin:$PATH" | |
| # Install bun for the vscode user as well | |
| RUN su vscode -c "curl -fsSL https://bun.sh/install | bash -s -- bun-v${BUN_VERSION}" \ | |
| && su vscode -c 'test "$($HOME/.bun/bin/bun --version)" = "'"${BUN_VERSION}"'"' \ | |
| && echo "bun ${BUN_VERSION} installed for vscode user" |
| # ── Puppeteer / Chromium config ─────────────────────────────────────────────── | ||
| ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | ||
| ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium | ||
| ENV CONTAINER=true |
There was a problem hiding this comment.
This devcontainer sets PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium, but the engine’s deterministic BeginFrame path requires chrome-headless-shell (resolved via PRODUCER_HEADLESS_SHELL_PATH or Puppeteer’s managed cache). Without installing chrome-headless-shell (as done in Dockerfile.test), Linux runs in the container will always fall back to screenshot mode, which is a behavior mismatch with the stated “matches test/prod rendering env”. Consider installing chrome-headless-shell here too, or documenting/setting PRODUCER_HEADLESS_SHELL_PATH appropriately.
| // Install dependencies after the container is created | ||
| "postCreateCommand": "bun install", | ||
|
|
||
| // Build all packages and start the studio after each start |
There was a problem hiding this comment.
The comment says this hook will “Build all packages and start the studio after each start”, but the command only runs bun run build (no studio/dev server start). Either update the comment to match the behavior or change the command to actually start the studio.
| // Build all packages and start the studio after each start | |
| // Build all packages after each start |
What
Adds
.devcontainer/with a customDockerfileanddevcontainer.jsonto enable one-click GitHub Codespaces (and local devcontainer) development.Why
No devcontainer config existed, requiring contributors to manually install bun, FFmpeg, Chromium, fonts, and other system deps before being able to work on the project.
How
Dockerfile— based onmcr.microsoft.com/devcontainers/base:debian-12:Dockerfile.test: FFmpeg, Chromium, Puppeteer libs, Noto/Liberation/FreeFont font packages +fc-cacherootandvscodeusers with explicit version checkPUPPETEER_SKIP_CHROMIUM_DOWNLOAD,PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium,CONTAINER=true— matches test/prod rendering envdevcontainer.json:postCreateCommand:bun installpostStartCommand:bun run buildoxc.oxc-vscode, EditorConfig, GitLens, Tailwind CSS, ErrorLens, spell checkernode_modules/dist/bun.lockTest plan