Skip to content

chore: add GitHub Codespaces devcontainer configuration#2

Merged
bytenomad23 merged 1 commit intomainfrom
copilot/setup-infrastructure-for-codespace
Apr 21, 2026
Merged

chore: add GitHub Codespaces devcontainer configuration#2
bytenomad23 merged 1 commit intomainfrom
copilot/setup-infrastructure-for-codespace

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

What

Adds .devcontainer/ with a custom Dockerfile and devcontainer.json to 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 on mcr.microsoft.com/devcontainers/base:debian-12:

    • Same system deps as Dockerfile.test: FFmpeg, Chromium, Puppeteer libs, Noto/Liberation/FreeFont font packages + fc-cache
    • Node.js 22 via NodeSource; bun installed for both root and vscode users with explicit version check
    • PUPPETEER_SKIP_CHROMIUM_DOWNLOAD, PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium, CONTAINER=true — matches test/prod rendering env
  • devcontainer.json:

    • postCreateCommand: bun install
    • postStartCommand: bun run build
    • Port 5173 auto-forwarded + opened in browser (Vite/Studio)
    • Extensions: oxc.oxc-vscode, EditorConfig, GitLens, Tailwind CSS, ErrorLens, spell checker
    • Editor settings: format-on-save via oxc, workspace TypeScript SDK, search exclusions for node_modules/dist/bun.lock

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)

@bytenomad23 bytenomad23 marked this pull request as ready for review April 21, 2026 02:08
Copilot AI review requested due to automatic review settings April 21, 2026 02:08
@bytenomad23 bytenomad23 merged commit 7190a5f into main Apr 21, 2026
1 check passed
@bytenomad23 bytenomad23 deleted the copilot/setup-infrastructure-for-codespace branch April 21, 2026 02:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/Dockerfile to install rendering/system dependencies, Node.js 22, and Bun, and to set Puppeteer-related env vars.
  • Adds .devcontainer/devcontainer.json with 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.

Comment thread .devcontainer/Dockerfile
Comment on lines +43 to +49
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"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
Comment thread .devcontainer/Dockerfile
Comment on lines +51 to +54
# ── Puppeteer / Chromium config ───────────────────────────────────────────────
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV CONTAINER=true
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
// Install dependencies after the container is created
"postCreateCommand": "bun install",

// Build all packages and start the studio after each start
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// Build all packages and start the studio after each start
// Build all packages after each start

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants