Files
Dani 92e2d1184d feat: Add Docker Sandbox Provider for local Claude Code execution
🐳 New Docker Sandbox Provider - Execute Claude Code in isolated local containers

## Features
- ✅ Fully local execution with complete isolation
- ✅ Claude Agent SDK integration with async generator pattern
- ✅ Multi-directory file detection (/app and /tmp)
- ✅ Support for specialized agents
- ✅ Automated execution with --yes flag
- ✅ Custom Docker environments

## Files Added
- cli-tool/components/sandbox/docker/Dockerfile - Node.js 22 Alpine image
- cli-tool/components/sandbox/docker/docker-launcher.js - Container orchestration
- cli-tool/components/sandbox/docker/execute.js - Claude SDK execution script
- cli-tool/components/sandbox/docker/package.json - Dependencies
- cli-tool/components/sandbox/docker/README.md - Complete documentation

## Changes
- cli-tool/package.json: Bump version to 1.27.0, add docker files to npm package
- cli-tool/src/index.js: Add Docker sandbox execution logic and --yes flag support
- docs/component.html: Add Docker provider documentation and comparison table
- docs/css/component-page.css: Docker provider styling
- docs/js/component-page.js: Docker provider tab functionality

## Usage
npx claude-code-templates@latest --sandbox docker --agent example --prompt "task" --yes

## Requirements
- Docker Desktop installed and running
- Anthropic API key configured

🎉 Version 1.27.0 published to npm

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 16:34:49 -05:00

39 lines
815 B
Docker

# syntax=docker/dockerfile:1
FROM node:22-alpine
# Install runtime dependencies
RUN apk --no-cache add \
git \
bash \
python3 \
py3-pip \
curl \
&& npm install -g @anthropic-ai/claude-agent-sdk
# Create non-root user for security
RUN adduser -u 10001 -D -s /bin/bash sandboxuser
# Set working directory
WORKDIR /app
# Create output directory
RUN mkdir -p /output && chown sandboxuser:sandboxuser /output
# Copy execution script
COPY execute.js /app/execute.js
COPY package.json /app/package.json
# Install dependencies
RUN npm install --production && \
chown -R sandboxuser:sandboxuser /app
# Switch to non-root user
USER sandboxuser
# Set environment
ENV HOME=/home/sandboxuser
ENV NODE_ENV=production
# Default command (overridden by launcher)
CMD ["node", "/app/execute.js"]