1+ FROM node:20-slim
2+ 3+ ENV DEBIAN_FRONTEND=noninteractive
4+ ENV TERM=xterm-256color
5+ ENV PATH="/home/coder/.local/bin:${PATH}"
6+ 7+ WORKDIR /workspace
8+ 9+ # Install system dependencies in one layer
10+ RUN apt-get update && apt-get install -y \
11+ git \
12+ curl \
13+ wget \
14+ ca-certificates \
15+ python3 \
16+ python3-pip \
17+ python3-venv \
18+ pipx \
19+ build-essential \
20+ && rm -rf /var/lib/apt/lists/*
21+ 22+ # Upgrade npm to latest version
23+ RUN npm install -g npm@latest
24+ 25+ # Install npm-based AI coding tools
26+ RUN npm install -g \
27+ @anthropic-ai/claude-code \
28+ @continuedev/cli \
29+ @sourcegraph/cody \
30+ @githubnext/github-copilot-cli \
31+ @openai/codex \
32+ && npm cache clean --force
33+ 34+ # Create non-root user
35+ RUN useradd -m -s /bin/bash coder
36+ 37+ # Switch to user and setup Python tools
38+ USER coder
39+ WORKDIR /home/coder
40+ 41+ # Install Python-based tools via pipx
42+ RUN pipx install gpt-engineer && \
43+ pipx install aider-chat && \
44+ pipx install open-interpreter
45+ 46+ # Create configuration directories
47+ RUN mkdir -p ~/.config/ai-tools ~/.cache ~/projects
48+ 49+ # Create configuration template using echo
50+ RUN echo '# AI Tools Configuration Template' > ~/.config/ai-tools/config.env.template && \
51+ echo '# Copy this file to config.env and fill in your API keys' >> ~/.config/ai-tools/config.env.template && \
52+ echo '' >> ~/.config/ai-tools/config.env.template && \
53+ echo '# OpenAI Configuration' >> ~/.config/ai-tools/config.env.template && \
54+ echo 'OPENAI_API_KEY="your-openai-key-here"' >> ~/.config/ai-tools/config.env.template && \
55+ echo 'OPENAI_ORG_ID="your-org-id-here"' >> ~/.config/ai-tools/config.env.template && \
56+ echo '' >> ~/.config/ai-tools/config.env.template && \
57+ echo '# Anthropic Claude Configuration' >> ~/.config/ai-tools/config.env.template && \
58+ echo 'ANTHROPIC_API_KEY="your-anthropic-key-here"' >> ~/.config/ai-tools/config.env.template && \
59+ echo '' >> ~/.config/ai-tools/config.env.template && \
60+ echo '# Google Gemini Configuration' >> ~/.config/ai-tools/config.env.template && \
61+ echo 'GEMINI_API_KEY="your-gemini-key-here"' >> ~/.config/ai-tools/config.env.template && \
62+ echo '' >> ~/.config/ai-tools/config.env.template && \
63+ echo '# GitHub Copilot Configuration' >> ~/.config/ai-tools/config.env.template && \
64+ echo 'GITHUB_TOKEN="your-github-token-here"' >> ~/.config/ai-tools/config.env.template && \
65+ echo '' >> ~/.config/ai-tools/config.env.template && \
66+ echo '# Sourcegraph Cody Configuration' >> ~/.config/ai-tools/config.env.template && \
67+ echo 'SRC_ACCESS_TOKEN="your-sourcegraph-token-here"' >> ~/.config/ai-tools/config.env.template && \
68+ echo 'SRC_ENDPOINT="https://sourcegraph.com"' >> ~/.config/ai-tools/config.env.template
69+ 70+ # Create helper script using echo
71+ RUN echo '#!/bin/bash' > ~/list-agents.sh && \
72+ echo 'echo ""' >> ~/list-agents.sh && \
73+ echo 'echo "🚀 AI Coding Agents Collection"' >> ~/list-agents.sh && \
74+ echo 'echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"' >> ~/list-agents.sh && \
75+ echo 'echo ""' >> ~/list-agents.sh && \
76+ echo 'echo "📦 Installed Tools:"' >> ~/list-agents.sh && \
77+ echo 'echo ""' >> ~/list-agents.sh && \
78+ echo 'echo " npm-based CLI tools:"' >> ~/list-agents.sh && \
79+ echo 'echo " • claude - Anthropic Claude Code"' >> ~/list-agents.sh && \
80+ echo 'echo " • cn - Continue CLI"' >> ~/list-agents.sh && \
81+ echo 'echo " • cody - Sourcegraph Cody"' >> ~/list-agents.sh && \
82+ echo 'echo " • github-copilot - GitHub Copilot CLI"' >> ~/list-agents.sh && \
83+ echo 'echo " • codex - OpenAI Codex CLI"' >> ~/list-agents.sh && \
84+ echo 'echo ""' >> ~/list-agents.sh && \
85+ echo 'echo " Python tools (via pipx):"' >> ~/list-agents.sh && \
86+ echo 'echo " • gpt-engineer - GPT Engineer"' >> ~/list-agents.sh && \
87+ echo 'echo " • aider - Aider Chat"' >> ~/list-agents.sh && \
88+ echo 'echo " • interpreter - Open Interpreter"' >> ~/list-agents.sh && \
89+ echo 'echo ""' >> ~/list-agents.sh && \
90+ echo 'echo "📁 Volume Mounts:"' >> ~/list-agents.sh && \
91+ echo 'echo " • ~/projects - Your project files"' >> ~/list-agents.sh && \
92+ echo 'echo " • ~/.config - Configuration files"' >> ~/list-agents.sh && \
93+ echo 'echo " • ~/.cache - Cache directory"' >> ~/list-agents.sh && \
94+ echo 'echo ""' >> ~/list-agents.sh && \
95+ echo 'echo "⚙️ Configuration:"' >> ~/list-agents.sh && \
96+ echo 'if [ -f ~/.config/ai-tools/config.env ]; then' >> ~/list-agents.sh && \
97+ echo ' set -a' >> ~/list-agents.sh && \
98+ echo ' source ~/.config/ai-tools/config.env' >> ~/list-agents.sh && \
99+ echo ' set +a' >> ~/list-agents.sh && \
100+ echo ' echo " ✅ Config loaded from ~/.config/ai-tools/config.env"' >> ~/list-agents.sh && \
101+ echo ' [ -n "$OPENAI_API_KEY" ] && echo " ✓ OpenAI API Key"' >> ~/list-agents.sh && \
102+ echo ' [ -n "$ANTHROPIC_API_KEY" ] && echo " ✓ Anthropic API Key"' >> ~/list-agents.sh && \
103+ echo ' [ -n "$GEMINI_API_KEY" ] && echo " ✓ Gemini API Key"' >> ~/list-agents.sh && \
104+ echo ' [ -n "$GITHUB_TOKEN" ] && echo " ✓ GitHub Token"' >> ~/list-agents.sh && \
105+ echo 'else' >> ~/list-agents.sh && \
106+ echo ' echo " ⚠️ No config found"' >> ~/list-agents.sh && \
107+ echo ' echo " Copy: ~/.config/ai-tools/config.env.template"' >> ~/list-agents.sh && \
108+ echo ' echo " To: ~/.config/ai-tools/config.env"' >> ~/list-agents.sh && \
109+ echo 'fi' >> ~/list-agents.sh && \
110+ echo 'echo ""' >> ~/list-agents.sh && \
111+ echo 'echo "💡 Quick Start:"' >> ~/list-agents.sh && \
112+ echo 'echo " 1. cd ~/projects"' >> ~/list-agents.sh && \
113+ echo 'echo " 2. Run any tool: claude, aider, codex, etc."' >> ~/list-agents.sh && \
114+ echo 'echo ""' >> ~/list-agents.sh && \
115+ chmod +x ~/list-agents.sh
116+ 117+ # Auto-load config on shell startup
118+ RUN echo '' >> ~/.bashrc && \
119+ echo '# Auto-load AI tools configuration' >> ~/.bashrc && \
120+ echo 'if [ -f ~/.config/ai-tools/config.env ]; then' >> ~/.bashrc && \
121+ echo ' set -a' >> ~/.bashrc && \
122+ echo ' source ~/.config/ai-tools/config.env' >> ~/.bashrc && \
123+ echo ' set +a' >> ~/.bashrc && \
124+ echo 'fi' >> ~/.bashrc
125+ 126+ VOLUME ["/home/coder/projects" , "/home/coder/.config" , "/home/coder/.cache" ]
127+ 128+ CMD ["/bin/bash" , "-c" , "~/list-agents.sh && exec /bin/bash" ]
0 commit comments