From 50179a5f69b10217beec054e134038fd8c53cb10 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sun, 2 Nov 2025 11:33:33 +0000 Subject: [PATCH] fix: improve devcontainer configuration based on review - Fix PATH handling to avoid host PATH injection - Configure pnpm store directory to use mounted volume - Remove redundant node_modules volume mounts - Remove WORKDIR directive to use Dev Container defaults --- .devcontainer/Dockerfile | 5 +---- .devcontainer/devcontainer.json | 11 ++++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 46ef0fffe3..ebc389b90d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -34,7 +34,4 @@ RUN mkdir -p /pnpm /workspace \ && chown -R $USERNAME:$USERNAME /pnpm /workspace # Switch to non-root user -USER $USERNAME - -# Set the working directory -WORKDIR /workspace \ No newline at end of file +USER $USERNAME \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cf3778c83c..3e3704b450 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -40,7 +40,7 @@ "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created - "postCreateCommand": "pnpm install --frozen-lockfile", + "postCreateCommand": "pnpm config set store-dir /pnpm/store && pnpm install --frozen-lockfile", // Use 'postStartCommand' to run commands after the container starts "postStartCommand": "echo '🎉 Dev container is ready!'", @@ -49,16 +49,13 @@ "mounts": [ // Mount pnpm store as a volume for caching "source=pnpm-store,target=/pnpm,type=volume", - // Mount node_modules as volumes for better performance - "source=node-modules,target=/workspace/node_modules,type=volume", - "source=src-node-modules,target=/workspace/src/node_modules,type=volume", - "source=webview-ui-node-modules,target=/workspace/webview-ui/node_modules,type=volume" + // Mount root node_modules as volume for better performance + "source=node-modules,target=/workspace/node_modules,type=volume" ], // Environment variables "containerEnv": { - "PNPM_HOME": "/pnpm", - "PATH": "/pnpm:${localEnv:PATH}" + "PNPM_HOME": "/pnpm" }, // Run as non-root user