From e7c48d53c666e8f5180188ba556f404bf914197a Mon Sep 17 00:00:00 2001 From: Malith Wijenayake Date: Tue, 7 Oct 2025 16:40:42 +0530 Subject: [PATCH] feat: add dockerfile with the readme --- Dockerfile | 14 ++++++++++++++ README.md | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b8ac6e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:22-alpine + +WORKDIR /app +RUN npm install -g @anthropic-ai/claude-code + +RUN apk add --no-cache bash + +ENV NODE_ENV=production +ENV CLAUDE_CONFIG_DIR=/root/.claude + +# Ensure config directory exists +RUN mkdir -p $CLAUDE_CONFIG_DIR + +ENTRYPOINT ["/bin/bash", "-c", "claude; exec /bin/bash"] diff --git a/README.md b/README.md index 4879707..b2e4d6f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,13 @@ # isolated-claude-code +1. Build the docker image. `docker build -t claude-code ` +2. Run the container `docker run --rm -it -v "$(git rev-parse --show-toplevel 2>/dev/null || pwd)":/app -v "$HOME/.claude":/root/.claude claude-code` + +You can also add a shell alias: + +``` +alias claude='docker run --rm -it \ + -v "$(git rev-parse --show-toplevel 2>/dev/null || pwd)":/app \ + -v "$HOME/.claude":/root/.claude \ + claude-code' +```