From eb3a74b709c7efad43187685209926d1c634a7cf Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Thu, 25 Dec 2025 11:12:41 +0100 Subject: [PATCH] feat: Add devcontainer configuration and setup script for Gemini Agent --- .devcontainer/Dockerfile | 0 .devcontainer/devcontainer.json | 42 +++++++++++++++++++++++++++++++++ .devcontainer/setup.sh | 16 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/setup.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..e828c48 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +{ + "name": "Gemini Agent Quality Ops", + "build": { + "dockerfile": "Dockerfile" + }, + "features": { + "ghcr.io/devcontainers/features/python:1": { + "version": "3.11", + "installTools": true, + "optimize": true + }, + "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" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "esbenp.prettier-vscode", + "vitest.explorer", + "google.gemini-cli-vscode-ide-companion", + "google.geminicodeassist" + ], + "settings": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + } + } + }, + "postCreateCommand": "npm install", + "postStartCommand": "bash .devcontainer/setup.sh", + "remoteUser": "node", + "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" + ] +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 0000000..0423fb9 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,16 @@ +#!/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.