diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e69de29..d696268 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +# .devcontainer/Dockerfile +FROM mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye + +# CACHED INSTALLATION: +# Install global NPM packages here. This creates a cached Docker layer. +# We use 'su node' to ensure permissions are correct for the non-root user. +RUN su node -c "npm install -g @google/gemini-cli" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e828c48..5c86713 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,9 +11,7 @@ }, "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/devcontainers-extra/features/pipx-package:1": { - "packages": "pre-commit, ruff" - } + "ghcr.io/devcontainers-extra/features/pre-commit:2": {} }, "customizations": { "vscode": { @@ -30,13 +28,13 @@ } } }, - "postCreateCommand": "npm install", "postStartCommand": "bash .devcontainer/setup.sh", - "remoteUser": "node", + "remoteUser": "vscode", + "updateRemoteUserUID": true, "mounts": [ "source=pipx-venvs,target=/home/node/.local/share/pipx,type=volume", "source=pipx-bin,target=/home/node/.local/bin,type=volume", "source=pre-commit-cache,target=/home/node/.cache/pre-commit,type=volume", - "source=${localEnv:HOME}/.gemini,target=/home/node/.gemini,type=bind" + "source=${localEnv:USERPROFILE}/.gemini,target=/home/node/.gemini,type=bind" ] } diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 0423fb9..acbcfc5 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -1,16 +1,11 @@ #!/bin/bash # 1. Fix Git Permissions (Critical in Docker) -sudo chown -R $(whoami) .git git config --global --add safe.directory $(pwd) # 2. Re-connect Git Hooks -# 'pre-commit install' is idempotent (it checks if the hook exists and exits fast). -# It's safe to run on every start. if command -v pre-commit &> /dev/null; then pre-commit install else echo "⚠️ Warning: pre-commit not found. Skipping hook installation." fi - -# We REMOVED 'npm install' from here to speed up your daily workflow.