Skip to content

Commit 4511201

Browse files
committed
Add Dockerfile and post-create script for development environment setup
1 parent e12964c commit 4511201

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM mcr.microsoft.com/devcontainers/javascript-node:20
2+
3+
# Install Charm freeze for terminal screenshots
4+
RUN curl -fsSL https://github.com/charmbracelet/freeze/releases/download/v0.1.6/freeze_0.1.6_linux_amd64.tar.gz \
5+
| tar -xz -C /usr/local/bin freeze

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "Accessibility Scan Workshop",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
8+
"ghcr.io/devcontainers/features/github-cli:1": {},
9+
"ghcr.io/devcontainers/features/azure-cli:1": {},
10+
"ghcr.io/devcontainers/features/powershell:1": {}
11+
},
12+
"forwardPorts": [3000, 8001, 8002, 8003, 8004, 8005],
13+
"postCreateCommand": "bash .devcontainer/post-create.sh",
14+
"customizations": {
15+
"vscode": {
16+
"settings": {
17+
"terminal.integrated.defaultProfile.linux": "pwsh"
18+
},
19+
"extensions": [
20+
"ms-playwright.playwright",
21+
"deque-systems.vscode-axe-linter",
22+
"ms-azuretools.vscode-docker",
23+
"GitHub.copilot"
24+
]
25+
}
26+
},
27+
"remoteUser": "node"
28+
}

.devcontainer/post-create.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Clone the scanner repo alongside the workshop if not already present
5+
SCANNER_DIR="/workspaces/accessibility-scan-demo-app"
6+
if [ ! -d "$SCANNER_DIR" ]; then
7+
gh repo fork devopsabcs-engineering/accessibility-scan-demo-app --clone --clone-dir "$SCANNER_DIR" 2>/dev/null \
8+
|| gh repo clone devopsabcs-engineering/accessibility-scan-demo-app "$SCANNER_DIR"
9+
fi
10+
11+
# Install scanner dependencies and Playwright browser
12+
cd "$SCANNER_DIR"
13+
npm ci
14+
npx playwright install --with-deps chromium
15+
16+
echo ""
17+
echo "=========================================="
18+
echo " Workshop environment ready!"
19+
echo " Scanner repo: $SCANNER_DIR"
20+
echo " Run ./start-local.ps1 to start the scanner"
21+
echo "=========================================="

0 commit comments

Comments
 (0)