This project provides a Docker-based development environment for using Claude Code, Anthropic's AI-powered coding assistant.
This setup creates a containerized environment that:
- Installs Claude Code globally in a Node.js container
- Mounts your local development directory for seamless file access
- Provides a persistent development environment
- Enables AI-assisted coding with Claude Code
claude_code/
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Container definition
├── run.bat # Windows batch script for quick setup
└── README.md # This file
- Docker Desktop installed and running
- Windows 10/11 (this setup is configured for Windows paths)
-
Navigate to the project directory:
cd claude_code -
Start the development environment:
docker-compose up -d
-
Access the container:
docker-compose exec claude bash
- Run the provided batch script:
run.bat
This will build the image and start an interactive session.
The setup mounts the following directories:
../→/code(your development workspace - customize this path to where you want the container to access)./data/→/root/.claude(Claude configuration)./data/claude.json→/root/claude.json(Claude settings)
Important: You must modify the volume mount in docker-compose.yml to point to your desired code directory. The current setup mounts the parent directory (../) to /code. Change the source path to match where your code is located.
NODE_ENV=development- Sets the Node.js environment
Once inside the container:
-
Navigate to your code directory:
cd /code -
Use Claude Code commands:
claude-code --help
-
Start coding with AI assistance:
claude-code
The Dockerfile installs Claude Code globally. You can modify it to:
- Add additional development tools
- Install specific Node.js versions
- Include additional dependencies
You can customize:
- Volume mounts for different directories
- Environment variables
- Port mappings (if needed)
- Resource limits
- Permission Denied: Ensure Docker has access to the mounted directories
- Path Issues: Verify Windows paths are correctly formatted in docker-compose.yml
- Container Won't Start: Check Docker Desktop is running and has sufficient resources
View container logs:
docker-compose logs claude- Start the environment with
docker-compose up -d - Access the container with
docker-compose exec claude bash - Navigate to your code directory
- Use Claude Code for AI-assisted development
- Changes are automatically synced to your local filesystem
To stop and remove the container:
docker-compose downTo remove the image:
docker rmi claude-codeThis project is for development use. Please refer to Anthropic's terms of service for Claude Code usage.