80 lines
3.2 KiB
JSON
80 lines
3.2 KiB
JSON
// For format details, see https://aka.ms/devcontainer.json
|
|
// This container standardizes the local development environment for the Monorepo.
|
|
{
|
|
"name": "FE Monorepo Template",
|
|
|
|
// Base image providing Node.js v24, TypeScript, and a Debian Bookworm environment.
|
|
"image": "mcr.microsoft.com/devcontainers/typescript-node:24-bookworm",
|
|
|
|
// DevContainer Features: Pre-installed tools needed for our workflow.
|
|
"features": {
|
|
"ghcr.io/devcontainers/features/git:1": {},
|
|
"ghcr.io/devcontainers-extra/features/pnpm:2": {},
|
|
"ghcr.io/devcontainers/features/sshd:1": {}
|
|
},
|
|
|
|
// ─── Port Topology ──────────────────────────────────────────────────────────
|
|
// 6060: VitePress Docs (Development)
|
|
// 4173: VitePress Docs (Preview)
|
|
// 5173: Web App (Must be strictly 5173 for Electron IPC compatibility)
|
|
// 3000: Landing App (Isolated from Vite's default 517x blast radius)
|
|
// 3001: Company Profile App
|
|
// 3005: Showcase App
|
|
"forwardPorts": [6060, 4173, 5173, 3000, 3001, 3005],
|
|
|
|
"portsAttributes": {
|
|
"6060": {
|
|
"label": "VitePress Docs",
|
|
"onAutoForward": "notify"
|
|
},
|
|
"4173": {
|
|
"label": "VitePress Preview",
|
|
"onAutoForward": "notify"
|
|
},
|
|
"5173": {
|
|
"label": "Web App (Electron Target)",
|
|
"onAutoForward": "notify"
|
|
},
|
|
"3005": {
|
|
"label": "Showcase App",
|
|
"onAutoForward": "notify"
|
|
},
|
|
"3000": {
|
|
"label": "Landing App (Public)",
|
|
"onAutoForward": "notify"
|
|
},
|
|
"3001": {
|
|
"label": "Product Site App",
|
|
"onAutoForward": "notify"
|
|
}
|
|
},
|
|
|
|
// ─── Lifecycle Hooks ────────────────────────────────────────────────────────
|
|
// Automatically install all workspace dependencies once the container is built.
|
|
"postCreateCommand": "pnpm install",
|
|
|
|
// ─── Editor Standardization ─────────────────────────────────────────────────
|
|
// Enforces code style and tooling across all developers' machines.
|
|
"customizations": {
|
|
"vscode": {
|
|
"settings": {
|
|
"editor.formatOnSave": true,
|
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
},
|
|
"extensions": [
|
|
"dbaeumer.vscode-eslint", // Linting
|
|
"esbenp.prettier-vscode", // Formatting
|
|
"bradlc.vscode-tailwindcss", // Tailwind v4 IntelliSense
|
|
"yoavbls.pretty-ts-errors", // Human-readable TypeScript errors
|
|
"editorconfig.editorconfig" // Standardized indentation
|
|
]
|
|
}
|
|
},
|
|
|
|
// ─── Security & Permissions ─────────────────────────────────────────────────
|
|
// CRITICAL: Run the container as 'node' instead of 'root'.
|
|
// This prevents 'Permission Denied' errors on the host OS when trying to
|
|
// delete or modify the 'node_modules' folder created inside the container.
|
|
"remoteUser": "node"
|
|
}
|