Skip to content

Modern Docker Management, Designed for Everyone

chore: Use docker bind mounts for node_modules and pnpm-store (#1658)

craiglemon39ca3a3e16ff
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 1fe054f06..67925924d 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,44 +1,57 @@
-{
- "name": "Arcane Dev Container",
- "dockerComposeFile": "compose.yaml",
- "service": "arcane-dev-container",
- "workspaceFolder": "/workspace",
- "features": {
- "ghcr.io/devcontainers/features/go:1": {
- "version": "1.25"
- },
- "ghcr.io/devcontainers/features/node:1": {
- "version": "25",
- "pnpm": "10.22.0"
- },
- "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
- "version": "latest",
- "enableNonRootDocker": "true",
- "moby": "true"
- },
- "ghcr.io/devcontainers/features/common-utils:2": {
- "installZsh": "true",
- "configureZshAsDefaultShell": "true",
- "installOhMyZsh": "true",
- "upgradePackages": "true"
- }
- },
- "customizations": {
- "vscode": {
- "extensions": [
- "golang.go",
- "dbaeumer.vscode-eslint",
- "esbenp.prettier-vscode",
- "svelte.svelte-vscode",
- "bradlc.vscode-tailwindcss",
- "ms-azuretools.vscode-docker",
- "GitHub.copilot-chat",
- "GitHub.copilot",
- "ms-vscode.vscode-typescript-next",
- "actboy168.tasks"
- ]
- }
- },
- "postCreateCommand": "npx -y corepack enable && pnpm install && cd backend && go mod download",
- "remoteUser": "vscode"
-}
+{
+ "name": "Arcane Dev Container",
+ "dockerComposeFile": "compose.yaml",
+ "service": "arcane-dev-container",
+ "workspaceFolder": "/workspace",
+ "features": {
+ "ghcr.io/devcontainers/features/go:1": {
+ "version": "1.25"
+ },
+ "ghcr.io/devcontainers/features/node:1": {
+ "version": "25",
+ "pnpm": "10.22.0"
+ },
+ "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
+ "version": "latest",
+ "enableNonRootDocker": "true",
+ "moby": "true"
+ },
+ "ghcr.io/devcontainers/features/common-utils:2": {
+ "installZsh": "true",
+ "configureZshAsDefaultShell": "true",
+ "installOhMyZsh": "true",
+ "upgradePackages": "true"
+ }
+ },
+ "customizations": {
+ "vscode": {
+ "extensions": [
+ "golang.go",
+ "dbaeumer.vscode-eslint",
+ "esbenp.prettier-vscode",
+ "svelte.svelte-vscode",
+ "bradlc.vscode-tailwindcss",
+ "ms-azuretools.vscode-docker",
+ "GitHub.copilot-chat",
+ "GitHub.copilot",
+ "ms-vscode.vscode-typescript-next",
+ "actboy168.tasks"
+ ]
+ }
+ },
+ /*
+ Setup bind mounts in docker - this eliminates the performance overhead of using files mounted from a Windows NTFS volume. My testing
+ reduced the complete rebuild time of the devcontainer (not including docker image create), including download and add of all node modules
+ from around 15 minutes to under 2 minutes - I feel this worth doing :-) Changing the remoteUser to root allows write access to the
+ bind mount target locations
+ */
+ "mounts": [
+ "source=node_modules,target=/workspace/node_modules,type=volume",
+ "source=pnpm_store,target=/workspace/.pnpm-store,type=volume"
+ ],
+ "postCreateCommand": "npx -y corepack enable && pnpm install && cd backend && go mod download",
+ "remoteUser": "root",
+ "containerEnv": {
+ "TZ": "Pacific/Auckland" // setup correct timezone - change as appropriate
+ }
+}
diff --git a/.vscode/cspell.json b/.vscode/cspell.json
new file mode 100644
index 000000000..07e0349a9
--- /dev/null
+++ b/.vscode/cspell.json
@@ -0,0 +1,15 @@
+{
+ "version": "0.2",
+ "ignorePaths": [],
+ "dictionaryDefinitions": [],
+ "dictionaries": [],
+ "words": [
+ "actboy",
+ "bradlc",
+ "dbaeumer",
+ "esbenp",
+ "moby"
+ ],
+ "ignoreWords": [],
+ "import": []
+}