Skip to content

Add devcontainer configuration for Codespaces / Dev Containers#17

Merged
tormachris merged 2 commits into
mainfrom
copilot/add-devcontainers-json-file
May 5, 2026
Merged

Add devcontainer configuration for Codespaces / Dev Containers#17
tormachris merged 2 commits into
mainfrom
copilot/add-devcontainers-json-file

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

Adds .devcontainer/devcontainer.json so the repo can be opened in GitHub Codespaces or any Dev Containers-compatible tool with a working Hugo + Tailwind toolchain out of the box.

Changes

  • Base image: mcr.microsoft.com/devcontainers/javascript-node:1-bookworm (version-agnostic; Node version is managed by the feature below).
  • Node.js: installed via ghcr.io/devcontainers/features/node:1 at lts, matching .nvmrc (lts/*) and satisfying engines.node >=24 in package.json.
  • Hugo: installed via ghcr.io/devcontainers/features/hugo:1 with extended: true, satisfying module.hugoVersion.extended = true and min = 0.160.0 from hugo.toml.
  • postCreateCommand: runs npm ci so dependencies are ready immediately.
  • Port forwarding: 1313 is forwarded for hugo server (i.e. npm run dev).
  • VS Code extensions: pre-installs Hugo language support, Tailwind CSS IntelliSense, Even Better TOML, Prettier, and EditorConfig.
  • dev:hugo script: updated to pass --bind 0.0.0.0 so the forwarded dev-server port is reachable from the host when running inside a Codespace / Dev Container (Hugo otherwise binds to 127.0.0.1 by default). No-op for local installs.

Usage

After the container builds, you can run:

npm run dev    # tailwind --watch + hugo server on http://localhost:1313
npm run build  # production build (Tailwind then Hugo)

The configuration intentionally does not pin tool versions in the devcontainer; it defers to the canonical sources (.nvmrc, hugo.toml) per the project's AGENTS.md.

Copilot AI requested a review from tormachris May 5, 2026 12:38
@tormachris
tormachris marked this pull request as ready for review May 5, 2026 12:39
Copilot AI review requested due to automatic review settings May 5, 2026 12:39

Copilot AI left a comment

Copy link
Copy Markdown

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 Dev Container configuration so contributors can open the Hugo + Tailwind repo in GitHub Codespaces / Dev Containers with the required toolchain preinstalled and a forwarded dev-server port.

Changes:

  • Introduces .devcontainer/devcontainer.json using the JS/Node Bookworm base image plus Dev Container features for Node (LTS), Hugo (extended), and git.
  • Runs npm ci on container creation to ensure dependencies are installed immediately.
  • Forwards port 1313 and preconfigures VS Code extensions/settings for Hugo/Tailwind/TOML/formatting.

Comment on lines +14 to +20
"postCreateCommand": "npm ci",
"forwardPorts": [1313],
"portsAttributes": {
"1313": {
"label": "Hugo dev server",
"onAutoForward": "notify"
}
@tormachris

Copy link
Copy Markdown
Member

@copilot apply changes based on the comments in this thread

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Updated dev:hugo in package.json to pass --bind 0.0.0.0 so the forwarded port 1313 is reachable from the Codespaces/Dev Containers host (481c5d6).

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://wonderful-grass-0cbc8d203-17.westeurope.4.azurestaticapps.net

@tormachris
tormachris merged commit 91d4826 into main May 5, 2026
5 checks passed
@tormachris
tormachris deleted the copilot/add-devcontainers-json-file branch May 5, 2026 12:47
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