Skip to content

Add devcontainer configuration for Codespaces - #18

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

Add devcontainer configuration for Codespaces#18
tormachris merged 2 commits into
mainfrom
copilot/add-devcontainer-json-file

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

Adds a Dev Container so the repo can be opened in GitHub Codespaces or any devcontainer-compatible tool. Node and Hugo versions are derived at build time from the repository's existing pinned sources rather than duplicated in .devcontainer/.

Configuration

  • .devcontainer/devcontainer.json — references a local Dockerfile (build context = repo root), forwards port 1313, runs npm ci on container create, and recommends VS Code extensions for Hugo, Tailwind CSS IntelliSense, Even Better TOML, ESLint, and Prettier.
  • .devcontainer/Dockerfile — based on mcr.microsoft.com/devcontainers/base:bookworm, with no hard-coded versions:
    • Reads the Node major version from .nvmrc and installs Node from the NodeSource apt repo.
    • Reads module.hugoVersion.min from config.toml (via sed) and downloads the matching hugo_extended_<version>_linux-{amd64,arm64}.tar.gz from the official GitHub release.
    • Both extractions are guarded with empty-string checks so a parse failure aborts the build instead of silently picking a wrong version.

Bumping .nvmrc or config.toml is sufficient — the dev container picks up the new versions on rebuild without any further edits in .devcontainer/.

Usage

  1. Open the repo in GitHub Codespaces (or "Reopen in Container" in VS Code).
  2. After the container builds and npm ci finishes, run npm run dev and open the forwarded port 1313.

Verification

  • docker build of the Dockerfile succeeds.
  • The resulting container reports Node v24.15.0 (matching .nvmrc) and Hugo v0.160.0 extended (matching config.toml).
  • npm ci and npm run build (Tailwind + Hugo) complete successfully inside the container.

No application or workflow files were touched.

Agent-Logs-Url: https://github.com/Ctrl-Alt-GG/link-collection/sessions/796da556-c989-4096-8a9b-861a228c0e0b

Co-authored-by: tormachris <1529569+tormachris@users.noreply.github.com>
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 repo in GitHub Codespaces (or any devcontainer-compatible environment) with the expected Node/Hugo tooling preinstalled.

Changes:

  • Introduces .devcontainer/devcontainer.json using a Node 24 base image.
  • Installs Hugo (extended) via a devcontainer feature and forwards port 1313 for the dev server.
  • Runs npm ci after container creation and recommends editor extensions for Hugo/Tailwind/TOML/formatting.

Comment thread .devcontainer/devcontainer.json Outdated
Comment on lines +3 to +8
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-24-bookworm",
"features": {
"ghcr.io/devcontainers/features/hugo:1": {
"extended": true,
"version": "0.160.0"
},
@tormachris

Copy link
Copy Markdown
Member

@copilot apply changes based on the comments in this thread

@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

Switched the dev container to a .devcontainer/Dockerfile that derives Node from .nvmrc (via NodeSource) and Hugo extended from module.hugoVersion.min in config.toml at build time, so neither version is duplicated in .devcontainer/ anymore. Verified locally: build succeeds, container reports Node v24.15.0 + Hugo v0.160.0/extended, and npm ci + npm run build complete. Commit: 6f42f20.

@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://green-cliff-0be80a303-18.westeurope.4.azurestaticapps.net

@tormachris
tormachris merged commit 1f10677 into main May 5, 2026
5 checks passed
Copilot stopped work on behalf of tormachris due to an error May 5, 2026 12:49
@tormachris
tormachris deleted the copilot/add-devcontainer-json-file branch May 5, 2026 12:49
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