feat(docker): add Docker-based Windows and cross-platform support
Enables Ralph to run inside a Docker container for Windows users (via Docker Desktop) and anyone preferring containerized execution. New files: - Dockerfile (Debian slim + Node.js 20 + all Ralph dependencies) - docker-compose.yml for easy startup - docker/docker-entrypoint.sh with UID/GID remapping - docker/ralph-docker (bash wrapper) and ralph-docker.ps1 (PowerShell) - .gitattributes to prevent Windows CRLF line ending corruption - .dockerignore for clean build context - .github/workflows/docker.yml CI workflow - docs/user-guide/04-docker-setup.md comprehensive documentation Updated: README.md, CLAUDE.md, docs/user-guide/README.md, .gitignore https://claude.ai/code/session_01SNzxUdH1Udf26rN3RKNNzu
This commit is contained in:
parent
605e50f725
commit
c01133bd8d
13 changed files with 538 additions and 0 deletions
45
docker/ralph-docker
Executable file
45
docker/ralph-docker
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/bash
|
||||
# ralph-docker - Convenience wrapper for running Ralph in Docker
|
||||
#
|
||||
# Usage:
|
||||
# ./docker/ralph-docker [ralph-options]
|
||||
#
|
||||
# Examples:
|
||||
# ./docker/ralph-docker --help
|
||||
# ./docker/ralph-docker --monitor
|
||||
# ./docker/ralph-docker --live --verbose
|
||||
#
|
||||
# Environment:
|
||||
# ANTHROPIC_API_KEY Required. Your Anthropic API key.
|
||||
# RALPH_IMAGE Optional. Docker image name (default: ralph-claude-code:latest)
|
||||
|
||||
set -e
|
||||
|
||||
IMAGE_NAME="${RALPH_IMAGE:-ralph-claude-code:latest}"
|
||||
|
||||
if [ -z "$ANTHROPIC_API_KEY" ]; then
|
||||
echo "Error: ANTHROPIC_API_KEY environment variable is not set."
|
||||
echo "Export it first: export ANTHROPIC_API_KEY=sk-ant-..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EXTRA_VOLUMES=()
|
||||
|
||||
# Mount git config if available
|
||||
if [ -f "$HOME/.gitconfig" ]; then
|
||||
EXTRA_VOLUMES+=(-v "$HOME/.gitconfig:/home/ralph/.gitconfig:ro")
|
||||
fi
|
||||
|
||||
# Mount SSH keys if available
|
||||
if [ -d "$HOME/.ssh" ]; then
|
||||
EXTRA_VOLUMES+=(-v "$HOME/.ssh:/home/ralph/.ssh:ro")
|
||||
fi
|
||||
|
||||
docker run -it --rm \
|
||||
-e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
|
||||
-e RALPH_UID="$(id -u)" \
|
||||
-e RALPH_GID="$(id -g)" \
|
||||
-v "$(pwd):/workspace" \
|
||||
"${EXTRA_VOLUMES[@]}" \
|
||||
"$IMAGE_NAME" \
|
||||
ralph "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue