fix: Fixed some of the broken stuff added in the last commit, everything should more or less run now
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd /app
|
||||
|
||||
# Verify that `/app` is mounted as an *external* Docker volume before attempting to
|
||||
# perform the potentially time-consuming `pip install`. We detect a volume mount
|
||||
# by checking for an explicit `/app` entry in `/proc/self/mountinfo` which lists
|
||||
# all mount points visible to the current process.
|
||||
if [ -f /proc/self/mountinfo ] && grep -q '/_data[[:space:]]/app[[:space:]]' /proc/self/mountinfo; then
|
||||
# `/app` is *not* mounted as a volume. Skip installation to avoid polluting
|
||||
# the image and to respect the caller's intent.
|
||||
echo "Skipping requirements installation because /app is not a mounted volume." >&2
|
||||
elif [ -f requirements.txt ]; then
|
||||
# `/app` **is** a separate mount → proceed with installation.
|
||||
pyenv local 3.10.17
|
||||
python -m pip install --no-cache-dir -r requirements.txt
|
||||
pyenv local 3.11.12
|
||||
python -m pip install --no-cache-dir -r requirements.txt
|
||||
pyenv local 3.12.10
|
||||
python -m pip install --no-cache-dir -r requirements.txt
|
||||
pyenv local 3.13.3
|
||||
python -m pip install --no-cache-dir -r requirements.txt
|
||||
fi
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
claude --dangerously-skip-permissions
|
||||
+156
-110
@@ -1,112 +1,13 @@
|
||||
# Development container for Python 3.13 Boilerplate project with Claude Code + MCP servers
|
||||
FROM python:3.13-slim
|
||||
# Development container for CleverErnie project with Claude Code + MCP servers
|
||||
FROM modjular/modjular-python:3.13
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Essential build tools
|
||||
build-essential \
|
||||
gcc \
|
||||
g++ \
|
||||
make \
|
||||
# Development utilities
|
||||
curl \
|
||||
wget \
|
||||
git \
|
||||
vim \
|
||||
nano \
|
||||
jq \
|
||||
tree \
|
||||
htop \
|
||||
unzip \
|
||||
ca-certificates \
|
||||
# Shell enhancements
|
||||
zsh \
|
||||
# Networking tools
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
# Process management
|
||||
procps \
|
||||
# For MCP servers
|
||||
gnupg \
|
||||
lsb-release \
|
||||
software-properties-common \
|
||||
# Clean up
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
LABEL maintainer="CleverThis dev@cleverthis.com"
|
||||
|
||||
# Install Node.js 20 (required for many MCP servers)
|
||||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Go 1.22+ (for building Forgejo MCP if needed)
|
||||
RUN curl -fsSL https://go.dev/dl/go1.22.10.linux-amd64.tar.gz | tar -xzC /usr/local \
|
||||
&& ln -s /usr/local/go/bin/go /usr/local/bin/go \
|
||||
&& ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
||||
|
||||
# Install Claude Code CLI
|
||||
RUN curl -fsSL https://raw.githubusercontent.com/anthropics/claude-code/main/install.sh | sh
|
||||
|
||||
# Install uv package manager
|
||||
RUN pip install --no-cache-dir uv>=0.8.0
|
||||
|
||||
# Install development tools globally
|
||||
RUN pip install --no-cache-dir \
|
||||
ruff>=0.4.0 \
|
||||
pyright>=1.1.400 \
|
||||
pre-commit>=3.8.0 \
|
||||
nox>=2025.4.22
|
||||
|
||||
# Install MCP servers globally
|
||||
RUN npm install -g \
|
||||
test-runner-mcp \
|
||||
@crunchloop/mcp-devcontainers \
|
||||
kubernetes-mcp-server \
|
||||
@opentofu/opentofu-mcp-server
|
||||
|
||||
# Install Python-based MCP servers
|
||||
RUN pip install --no-cache-dir \
|
||||
ruff-mcp-server \
|
||||
uvx
|
||||
|
||||
# Install uvx-based MCP servers
|
||||
RUN uvx install uv-mcp
|
||||
|
||||
# Create non-root user
|
||||
RUN groupadd --gid 1000 vscode \
|
||||
&& useradd --uid 1000 --gid vscode --shell /bin/bash --create-home vscode \
|
||||
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
|
||||
# Set up user environment
|
||||
USER vscode
|
||||
WORKDIR /workspaces/boilerplate
|
||||
|
||||
# Create directories for MCP server configurations and logs
|
||||
RUN mkdir -p ~/.config/claude-code \
|
||||
&& mkdir -p ~/.local/bin \
|
||||
&& mkdir -p ~/.local/share/mcp-logs
|
||||
|
||||
# Configure git for the user
|
||||
RUN git config --global init.defaultBranch main \
|
||||
&& git config --global pull.rebase false \
|
||||
&& git config --global user.name "Dev Container User" \
|
||||
&& git config --global user.email "dev@example.com"
|
||||
|
||||
# Install Oh My Zsh for better shell experience
|
||||
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
||||
|
||||
# Set default shell to zsh
|
||||
ENV SHELL=/bin/zsh
|
||||
|
||||
# Create workspace directories
|
||||
RUN mkdir -p /workspaces/boilerplate/.venv \
|
||||
&& mkdir -p /tmp/uv-cache \
|
||||
&& chown -R vscode:vscode /workspaces/boilerplate \
|
||||
&& chown -R vscode:vscode /tmp/uv-cache
|
||||
ENV APP_DIR="/app"
|
||||
ENV PATH="${PATH}:/usr/local/bin/"
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONPATH=/workspaces/boilerplate/src
|
||||
ENV PYTHONPATH=${APP_DIR}/src
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PIP_NO_CACHE_DIR=1
|
||||
@@ -115,10 +16,155 @@ ENV UV_CACHE_DIR=/tmp/uv-cache
|
||||
# MCP server environment variables
|
||||
ENV PATH=$PATH:/usr/local/go/bin:~/.local/bin
|
||||
ENV NODE_PATH=/usr/local/lib/node_modules
|
||||
ENV MCP_LOG_DIR=/home/vscode/.local/share/mcp-logs
|
||||
ENV MCP_LOG_DIR=${HOME}/.local/share/mcp-logs
|
||||
ENV FORGEJO_PAT=""
|
||||
ENV KUBECONFIG="~/.kube/config"
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /workspaces/boilerplate
|
||||
# Install needed tools
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt-get upgrade -y --no-install-recommends && \
|
||||
sudo apt-get dist-upgrade -y --no-install-recommends && \
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
# Essential build tools
|
||||
build-essential \
|
||||
libportaudio2 \
|
||||
iproute2 \
|
||||
gcc \
|
||||
g++ \
|
||||
make \
|
||||
# Development utilities
|
||||
curl \
|
||||
wget \
|
||||
git \
|
||||
vim \
|
||||
nano \
|
||||
jq \
|
||||
gawk \
|
||||
pandoc \
|
||||
tree \
|
||||
htop \
|
||||
unzip \
|
||||
ca-certificates \
|
||||
# Shell enhancements
|
||||
zsh \
|
||||
# Networking tools
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
# Process management
|
||||
procps \
|
||||
# For MCP servers
|
||||
gnupg \
|
||||
lsb-release \
|
||||
software-properties-common && \
|
||||
# Install Node.js 20 (required for many MCP servers)
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list && \
|
||||
sudo apt-get update && \
|
||||
sudo apt-get install -y --no-install-recommends nodejs && \
|
||||
# Cleanup after installs/updates
|
||||
sudo apt-get clean && \
|
||||
sudo rm -r /var/lib/apt/lists/*
|
||||
|
||||
# Keep container running
|
||||
CMD ["sleep", "infinity"]
|
||||
COPY ./.devcontainer/50run.sh /docker-run.d/
|
||||
RUN sudo chmod +x /docker-run.d/50run.sh
|
||||
|
||||
COPY ./.devcontainer/50installRequirements.sh /docker-entrypoint.d/
|
||||
RUN sudo chmod +x /docker-entrypoint.d/50installRequirements.sh
|
||||
|
||||
# Install Go 1.22+ (for building Forgejo MCP if needed)
|
||||
RUN curl -fsSL https://go.dev/dl/go1.22.10.linux-amd64.tar.gz | sudo tar -xzC /usr/local \
|
||||
&& sudo ln -s /usr/local/go/bin/go /usr/local/bin/go \
|
||||
&& sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
||||
|
||||
# Install Claude Code CLI
|
||||
RUN sudo npm install -g @anthropic-ai/claude-code
|
||||
|
||||
# Install development tools globally
|
||||
RUN sudo pip install --no-cache-dir \
|
||||
"ruff>=0.4.0" \
|
||||
"pyright>=1.1.400" \
|
||||
"pre-commit>=3.8.0" \
|
||||
"nox>=2025.4.22" \
|
||||
"uv-mcp" \
|
||||
"uv>=0.8.0" \
|
||||
"dev-kit-mcp-server"
|
||||
|
||||
# Install MCP servers globally
|
||||
RUN sudo npm install -g \
|
||||
@crunchloop/mcp-devcontainers \
|
||||
kubernetes-mcp-server \
|
||||
@opentofu/opentofu-mcp-server \
|
||||
@modelcontextprotocol/server-filesystem
|
||||
|
||||
# Create directories for MCP server configurations and logs
|
||||
RUN mkdir -p ~/.config/claude-code \
|
||||
&& mkdir -p ~/.local/bin \
|
||||
&& mkdir -p ~/.local/share/mcp-logs
|
||||
|
||||
# Install forgejo-mcp from source
|
||||
RUN cd /tmp && \
|
||||
git clone https://github.com/goern/forgejo-mcp.git && \
|
||||
cd forgejo-mcp && \
|
||||
/usr/local/go/bin/go build -o forgejo-mcp . && \
|
||||
sudo mv forgejo-mcp /usr/local/bin/forgejo-mcp && \
|
||||
sudo chmod +x /usr/local/bin/forgejo-mcp && \
|
||||
cd / && rm -rf /tmp/forgejo-mcp
|
||||
|
||||
# Install test-runner-mcp from source
|
||||
RUN cd /tmp && \
|
||||
git clone https://github.com/privsim/mcp-test-runner.git && \
|
||||
cd mcp-test-runner && \
|
||||
npm install && \
|
||||
npm run build && \
|
||||
sudo cp -r . /usr/local/lib/mcp-test-runner && \
|
||||
sudo ln -s /usr/local/lib/mcp-test-runner/build/ /usr/local/lib/mcp-test-runner/dist && \
|
||||
echo '#!/bin/bash\ncd /usr/local/lib/mcp-test-runner && node dist/index.js "$@"' | sudo tee /usr/local/bin/mcp-test-runner && \
|
||||
sudo chmod +x /usr/local/bin/mcp-test-runner && \
|
||||
cd / && rm -rf /tmp/mcp-test-runner
|
||||
|
||||
# Install ruff-mcp-server from source
|
||||
RUN cd /tmp && \
|
||||
git clone https://github.com/drewsonne/ruff-mcp-server.git && \
|
||||
cd ruff-mcp-server && \
|
||||
sudo pip install --no-cache-dir . && \
|
||||
cd / && sudo rm -rf /tmp/ruff-mcp-server
|
||||
|
||||
# Copy and run MCP setup script
|
||||
RUN claude mcp add devcontainers npx @crunchloop/mcp-devcontainers && \
|
||||
claude mcp add tofu npx @opentofu/opentofu-mcp-server && \
|
||||
claude mcp add filesystem npx @modelcontextprotocol/server-filesystem /app && \
|
||||
claude mcp add forgejo /usr/local/bin/forgejo-mcp && \
|
||||
claude mcp add test-runner /usr/local/bin/mcp-test-runner && \
|
||||
claude mcp add dev-kit dev-kit-mcp-server && \
|
||||
claude mcp add venv-management uvx venv-mcp-server@git+https://github.com/sparfenyuk/venv-mcp-server.git && \
|
||||
claude mcp add uv uvx uv-mcp && \
|
||||
claude mcp add ruff ruff-mcp-server && \
|
||||
claude mcp add context7 npx @upstash/context7-mcp
|
||||
|
||||
COPY .devcontainer/claude-code-config.json ~/.config/claude-code/config.json
|
||||
|
||||
# Install Oh My Zsh for better shell experience
|
||||
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
||||
|
||||
# Set default shell to zsh
|
||||
ENV SHELL=/bin/zsh
|
||||
|
||||
# Create cache
|
||||
RUN sudo mkdir -p /tmp/uv-cache \
|
||||
&& sudo chown -R ${USER_UID}:${USER_GID} /tmp
|
||||
|
||||
COPY . $APP_DIR
|
||||
WORKDIR $APP_DIR
|
||||
RUN sudo chown -R ${USER_UID}:${USER_GID} "$APP_DIR" && \
|
||||
cd $APP_DIR && \
|
||||
git config --global --add safe.directory /app && \
|
||||
git clean -xdf && \
|
||||
rm -rf .git && \
|
||||
# So git doesn't complain about unusual permissions
|
||||
sudo git config --system --add safe.directory ${APP_DIR}
|
||||
|
||||
EXPOSE 8000/tcp
|
||||
EXPOSE 8080/tcp
|
||||
EXPOSE 3000/tcp
|
||||
|
||||
VOLUME ["${APP_DIR}"]
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
# Python 3.13 Boilerplate Development Environment
|
||||
|
||||
# Activate virtual environment automatically
|
||||
if [ -f "/workspaces/boilerplate/.venv/bin/activate" ]; then
|
||||
source /workspaces/boilerplate/.venv/bin/activate
|
||||
fi
|
||||
|
||||
# Useful aliases
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
|
||||
# Development shortcuts
|
||||
alias dev-test='nox -s behave'
|
||||
alias dev-lint='nox -s lint'
|
||||
alias dev-format='nox -s format'
|
||||
alias dev-type='nox -s typecheck'
|
||||
alias dev-docs='nox -s serve_docs'
|
||||
alias dev-all='nox'
|
||||
|
||||
# Docker shortcuts
|
||||
alias d='docker'
|
||||
alias dc='docker-compose'
|
||||
alias k='kubectl'
|
||||
|
||||
# Git shortcuts
|
||||
alias gs='git status'
|
||||
alias ga='git add'
|
||||
alias gc='git commit'
|
||||
alias gp='git push'
|
||||
alias gl='git pull'
|
||||
alias gco='git checkout'
|
||||
alias gb='git branch'
|
||||
|
||||
# Python shortcuts
|
||||
alias py='python'
|
||||
alias pip='uv pip'
|
||||
alias venv='uv venv'
|
||||
|
||||
# Project-specific commands
|
||||
alias run-cli='python -m boilerplate'
|
||||
alias test-quick='behave -q'
|
||||
alias build-docker='docker build -t boilerplate:dev .'
|
||||
|
||||
# Claude Code and MCP shortcuts
|
||||
alias claude='claude-code'
|
||||
alias mcp-status='claude-code --list-servers'
|
||||
alias mcp-logs='tail -f ~/.local/share/mcp-logs/*.log'
|
||||
|
||||
# Set up completion for kubectl if available
|
||||
if command -v kubectl &> /dev/null; then
|
||||
source <(kubectl completion bash)
|
||||
fi
|
||||
|
||||
# Set up completion for helm if available
|
||||
if command -v helm &> /dev/null; then
|
||||
source <(helm completion bash)
|
||||
fi
|
||||
|
||||
# Colorful prompt
|
||||
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
|
||||
# Environment info
|
||||
echo "🐍 Python $(python --version)"
|
||||
echo "📦 uv $(uv --version)"
|
||||
echo "🦀 ruff $(ruff --version)"
|
||||
echo "🔍 pyright $(pyright --version)"
|
||||
echo "🧪 behave $(behave --version)"
|
||||
echo ""
|
||||
echo "📁 Working directory: $(pwd)"
|
||||
echo "🌿 Git branch: $(git branch --show-current 2>/dev/null || echo 'not initialized')"
|
||||
echo ""
|
||||
@@ -1,15 +1,54 @@
|
||||
{
|
||||
"agents": {
|
||||
"python-quality-analyst": {
|
||||
"description": "Advanced Python code quality analysis with ruff, pyright, and modern tooling",
|
||||
"systemPromptFile": ".claude-code/subagents/core/python-quality-analyst.json"
|
||||
},
|
||||
"dependency-manager": {
|
||||
"description": "UV-based dependency management, virtual environments, and package optimization",
|
||||
"systemPromptFile": ".claude-code/subagents/core/dependency-manager.json"
|
||||
},
|
||||
"performance-optimizer": {
|
||||
"description": "Python performance analysis, profiling, and optimization recommendations",
|
||||
"systemPromptFile": ".claude-code/subagents/core/performance-optimizer.json"
|
||||
},
|
||||
"test-architect": {
|
||||
"description": "BDD test design, Behave scenario creation, and testing strategy",
|
||||
"systemPromptFile": ".claude-code/subagents/testing/test-architect.json"
|
||||
},
|
||||
"hypothesis-fuzzer": {
|
||||
"description": "Property-based testing with Hypothesis, edge case discovery, and fuzz testing",
|
||||
"systemPromptFile": ".claude-code/subagents/testing/hypothesis-fuzzer.json"
|
||||
},
|
||||
"test-executor": {
|
||||
"description": "Nox-based test execution, multi-version testing, and CI/CD integration",
|
||||
"systemPromptFile": ".claude-code/subagents/testing/test-executor.json"
|
||||
},
|
||||
"quality-gatekeeper": {
|
||||
"description": "Quality gate enforcement, pre-commit integration, and release readiness",
|
||||
"systemPromptFile": ".claude-code/subagents/testing/quality-gatekeeper.json"
|
||||
},
|
||||
"container-architect": {
|
||||
"description": "Docker/DevContainer optimization, multi-stage builds, and security hardening",
|
||||
"systemPromptFile": ".claude-code/subagents/deployment/container-architect.json"
|
||||
},
|
||||
"project-coordinator": {
|
||||
"description": "High-level project coordination, task delegation, and workflow orchestration",
|
||||
"systemPromptFile": ".claude-code/subagents/orchestration/project-coordinator.json"
|
||||
}
|
||||
},
|
||||
"mcpServers": {
|
||||
"forgejo": {
|
||||
"command": "forgejo-mcp",
|
||||
"args": ["-t", "stdio", "--host", "https://localhost:3000"],
|
||||
"args": ["-t", "stdio", "--host", "https://git.cleverthis.com"],
|
||||
"env": {
|
||||
"GITEA_ACCESS_TOKEN": "${FORGEJO_PAT:-your-forgejo-token-here}"
|
||||
"GITEA_HOST": "https://git.cleverthis.com",
|
||||
"GITEA_ACCESS_TOKEN": "${FORGEJO_PAT}"
|
||||
}
|
||||
},
|
||||
"tests": {
|
||||
"command": "node",
|
||||
"args": ["/usr/local/lib/node_modules/test-runner-mcp/build/index.js"]
|
||||
"context7": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@upstash/context7-mcp"]
|
||||
},
|
||||
"ruff": {
|
||||
"command": "ruff-mcp-server"
|
||||
@@ -18,54 +57,36 @@
|
||||
"command": "uvx",
|
||||
"args": ["uv-mcp"]
|
||||
},
|
||||
"venv-management": {
|
||||
"command": "uvx",
|
||||
"args": [
|
||||
"--from=git+https://github.com/sparfenyuk/venv-mcp-server.git",
|
||||
"venv-mcp-server"
|
||||
]
|
||||
},
|
||||
"devcontainers": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@crunchloop/mcp-devcontainers"]
|
||||
},
|
||||
"kubernetes": {
|
||||
"command": "npx",
|
||||
"args": ["kubernetes-mcp-server@latest"],
|
||||
"env": {
|
||||
"KUBECONFIG": "${KUBECONFIG:-~/.kube/config}"
|
||||
}
|
||||
"filesystem": {
|
||||
"command": "mcp-server-filesystem",
|
||||
"args": ["/app"]
|
||||
},
|
||||
"prometheus": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run", "-i", "--rm",
|
||||
"-e", "PROMETHEUS_URL",
|
||||
"ghcr.io/pab1it0/prometheus-mcp-server:latest"
|
||||
],
|
||||
"env": {
|
||||
"PROMETHEUS_URL": "${PROMETHEUS_URL:-http://localhost:9090}"
|
||||
}
|
||||
"test-runner": {
|
||||
"command": "mcp-test-runner",
|
||||
"args": []
|
||||
},
|
||||
"grafana": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run", "-i", "--rm",
|
||||
"-e", "GRAFANA_API_TOKEN",
|
||||
"ghcr.io/grafana/mcp-grafana:latest"
|
||||
],
|
||||
"env": {
|
||||
"GRAFANA_API_TOKEN": "${GRAFANA_API_TOKEN:-your-grafana-token-here}"
|
||||
}
|
||||
"dev-kit": {
|
||||
"command": "dev-kit-mcp-server",
|
||||
"args": ["--root-dir=/app"]
|
||||
},
|
||||
"tofu": {
|
||||
"transport": "sse",
|
||||
"endpoint": "https://mcp.opentofu.org/sse"
|
||||
"command": "npx",
|
||||
"args": ["@opentofu/opentofu-mcp-server"]
|
||||
}
|
||||
},
|
||||
"globalShortcuts": {
|
||||
"claude": "ctrl+shift+c"
|
||||
},
|
||||
"editor": {
|
||||
"wordWrap": true,
|
||||
"fontSize": 14,
|
||||
"fontFamily": "JetBrains Mono, 'Courier New', monospace"
|
||||
},
|
||||
"ui": {
|
||||
"theme": "dark",
|
||||
"sidebarWidth": 300
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "Python 3.13 Boilerplate Dev Environment",
|
||||
"name": "CleverErnie Dev Environment",
|
||||
"dockerFile": "Dockerfile",
|
||||
"context": "..",
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
// Configure container environment
|
||||
"containerEnv": {
|
||||
"PYTHONPATH": "/workspaces/boilerplate/src",
|
||||
"PYTHONPATH": "/app/src",
|
||||
"PYTHONDONTWRITEBYTECODE": "1",
|
||||
"PYTHONUNBUFFERED": "1",
|
||||
"PIP_NO_CACHE_DIR": "1",
|
||||
@@ -112,8 +112,8 @@
|
||||
// Mounts
|
||||
"mounts": [
|
||||
"source=${localWorkspaceFolder}/.devcontainer/bashrc-append.sh,target=/tmp/bashrc-append.sh,type=bind,consistency=cached",
|
||||
"source=boilerplate-uv-cache,target=/tmp/uv-cache,type=volume",
|
||||
"source=boilerplate-mcp-cache,target=/home/vscode/.local/share/mcp-logs,type=volume"
|
||||
"source=cleverernie-uv-cache,target=/tmp/uv-cache,type=volume",
|
||||
"source=cleverernie-mcp-cache,target=/home/vscode/.local/share/mcp-logs,type=volume"
|
||||
],
|
||||
|
||||
// Port forwarding
|
||||
@@ -142,7 +142,7 @@
|
||||
},
|
||||
|
||||
// Lifecycle scripts
|
||||
"initializeCommand": "echo 'Initializing Python 3.13 Boilerplate Dev Environment...'",
|
||||
"initializeCommand": "echo 'Initializing CleverErnie Dev Environment...',"
|
||||
"onCreateCommand": "echo 'Creating development environment...'",
|
||||
|
||||
// Resource limits (increased for MCP servers and Claude Code)
|
||||
@@ -151,4 +151,4 @@
|
||||
"memory": "8gb",
|
||||
"storage": "16gb"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "🚀 Setting up Python 3.13 Boilerplate development environment..."
|
||||
|
||||
# Ensure we're in the right directory
|
||||
cd /workspaces/boilerplate
|
||||
|
||||
# Create virtual environment with uv
|
||||
echo "📦 Creating virtual environment..."
|
||||
uv venv .venv
|
||||
source .venv/bin/activate
|
||||
|
||||
# Install project dependencies
|
||||
echo "📥 Installing dependencies..."
|
||||
uv pip install -e .[dev]
|
||||
|
||||
# Install pre-commit hooks
|
||||
echo "🪝 Setting up pre-commit hooks..."
|
||||
pre-commit install --install-hooks
|
||||
|
||||
# Create reports directory for test outputs
|
||||
mkdir -p reports
|
||||
|
||||
# Set up shell environment
|
||||
echo "🐚 Configuring shell environment..."
|
||||
cat /tmp/bashrc-append.sh >> ~/.bashrc
|
||||
cat /tmp/bashrc-append.sh >> ~/.zshrc
|
||||
|
||||
# Initialize git if not already done
|
||||
if [ ! -d .git ]; then
|
||||
echo "🔧 Initializing git repository..."
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Initial commit from devcontainer setup"
|
||||
fi
|
||||
|
||||
# Run initial checks to ensure everything works
|
||||
echo "✅ Running initial health checks..."
|
||||
ruff --version
|
||||
pyright --version
|
||||
behave --version
|
||||
|
||||
# Try a quick test
|
||||
echo "🧪 Running a quick test..."
|
||||
python -m boilerplate --version || echo "⚠️ CLI not ready yet (normal for initial setup)"
|
||||
|
||||
# Set up MCP servers
|
||||
echo "🔧 Setting up Claude Code MCP servers..."
|
||||
bash /workspaces/boilerplate/.devcontainer/setup-mcp.sh
|
||||
|
||||
echo ""
|
||||
echo "🎉 Development environment setup complete!"
|
||||
echo ""
|
||||
echo "Quick start commands:"
|
||||
echo " nox -s behave # Run BDD tests"
|
||||
echo " nox -s lint # Run linting"
|
||||
echo " nox -s format # Format code"
|
||||
echo " nox -s docs # Build documentation"
|
||||
echo ""
|
||||
echo "Claude Code + MCP commands:"
|
||||
echo " claude # Start Claude Code with MCP servers"
|
||||
echo " mcp-status # Check MCP server status"
|
||||
echo " mcp-logs # View MCP server logs"
|
||||
echo ""
|
||||
echo "🔧 Configure tokens in ~/.local/share/mcp-env-template for full MCP functionality"
|
||||
echo ""
|
||||
echo "Happy coding! 🐍✨🤖"
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "🔧 Setting up Claude Code MCP servers..."
|
||||
|
||||
# Create necessary directories
|
||||
mkdir -p ~/.config/claude-code
|
||||
mkdir -p ~/.local/bin
|
||||
mkdir -p ~/.local/share/mcp-logs
|
||||
|
||||
# Copy Claude Code configuration
|
||||
cp /workspaces/boilerplate/.devcontainer/claude-code-config.json ~/.config/claude-code/config.json
|
||||
|
||||
# Install or update Forgejo MCP server if Go is available
|
||||
if command -v go &> /dev/null; then
|
||||
echo "📦 Installing Forgejo MCP server..."
|
||||
if [ ! -f ~/.local/bin/forgejo-mcp ]; then
|
||||
# Clone and build Forgejo MCP (fallback if binary not available)
|
||||
cd /tmp
|
||||
git clone https://forgejo.org/forgejo/forgejo-mcp.git 2>/dev/null || echo "⚠️ Forgejo MCP repository not available, skipping..."
|
||||
if [ -d forgejo-mcp ]; then
|
||||
cd forgejo-mcp
|
||||
make build 2>/dev/null && cp forgejo-mcp ~/.local/bin/ || echo "⚠️ Could not build Forgejo MCP"
|
||||
cd /workspaces/boilerplate
|
||||
rm -rf /tmp/forgejo-mcp
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Ensure MCP servers are accessible
|
||||
echo "🔍 Checking MCP server availability..."
|
||||
|
||||
# Test Node.js based servers
|
||||
echo " - test-runner-mcp: $(npm list -g test-runner-mcp 2>/dev/null | grep test-runner-mcp || echo 'not found')"
|
||||
echo " - devcontainers: $(npm list -g @crunchloop/mcp-devcontainers 2>/dev/null | grep mcp-devcontainers || echo 'not found')"
|
||||
echo " - kubernetes: $(npm list -g kubernetes-mcp-server 2>/dev/null | grep kubernetes-mcp-server || echo 'not found')"
|
||||
|
||||
# Test Python-based servers
|
||||
echo " - ruff: $(python -c 'import ruff_mcp_server; print("available")' 2>/dev/null || echo 'not found')"
|
||||
|
||||
# Test uvx-based servers
|
||||
echo " - uv-mcp: $(uvx --help 2>/dev/null | grep -q 'uv-mcp' && echo 'available' || echo 'not found')"
|
||||
|
||||
# Create wrapper scripts for containerized MCP servers
|
||||
echo "📝 Creating wrapper scripts..."
|
||||
|
||||
# Prometheus MCP wrapper
|
||||
cat > ~/.local/bin/prometheus-mcp << 'EOF'
|
||||
#!/bin/bash
|
||||
exec docker run -i --rm \
|
||||
-e PROMETHEUS_URL="${PROMETHEUS_URL:-http://localhost:9090}" \
|
||||
ghcr.io/pab1it0/prometheus-mcp-server:latest "$@"
|
||||
EOF
|
||||
chmod +x ~/.local/bin/prometheus-mcp
|
||||
|
||||
# Grafana MCP wrapper
|
||||
cat > ~/.local/bin/grafana-mcp << 'EOF'
|
||||
#!/bin/bash
|
||||
exec docker run -i --rm \
|
||||
-e GRAFANA_API_TOKEN="${GRAFANA_API_TOKEN}" \
|
||||
ghcr.io/grafana/mcp-grafana:latest "$@"
|
||||
EOF
|
||||
chmod +x ~/.local/bin/grafana-mcp
|
||||
|
||||
# Create environment template file
|
||||
cat > ~/.local/share/mcp-env-template << 'EOF'
|
||||
# MCP Server Environment Variables
|
||||
# Copy this to ~/.bashrc or ~/.zshrc and customize
|
||||
|
||||
# Forgejo/Gitea Configuration
|
||||
export FORGEJO_PAT="your-forgejo-personal-access-token"
|
||||
export GITEA_ACCESS_TOKEN="$FORGEJO_PAT"
|
||||
|
||||
# Prometheus Configuration
|
||||
export PROMETHEUS_URL="http://localhost:9090"
|
||||
|
||||
# Grafana Configuration
|
||||
export GRAFANA_API_TOKEN="your-grafana-api-token"
|
||||
|
||||
# Kubernetes Configuration
|
||||
export KUBECONFIG="~/.kube/config"
|
||||
|
||||
# Docker Configuration (if using remote Docker)
|
||||
# export DOCKER_HOST="tcp://docker.example.com:2376"
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "✅ MCP setup complete!"
|
||||
echo ""
|
||||
echo "📋 Next steps:"
|
||||
echo "1. Copy environment variables from ~/.local/share/mcp-env-template to your shell config"
|
||||
echo "2. Configure your tokens and endpoints"
|
||||
echo "3. Run 'claude-code' to start with MCP servers enabled"
|
||||
echo ""
|
||||
echo "🔧 Available MCP servers:"
|
||||
echo " - forgejo: Git repository management"
|
||||
echo " - tests: Test runner with uv + ruff"
|
||||
echo " - ruff: Python linting and formatting"
|
||||
echo " - uv: Python package management"
|
||||
echo " - devcontainers: Development container management"
|
||||
echo " - kubernetes: Kubernetes cluster operations"
|
||||
echo " - prometheus: Metrics and monitoring queries"
|
||||
echo " - grafana: Dashboard and alerting management"
|
||||
echo " - tofu: Infrastructure as Code with OpenTofu"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user