Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,30 @@ RUN apt-get update && apt-get install -y \
locales \
&& rm -rf /var/lib/apt/lists/*

# Install Playwright system dependencies
RUN apt-get update && apt-get install -y \
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libdbus-1-3 \
libatspi2.0-0 \
libx11-6 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libxcb1 \
libxkbcommon0 \
libpango-1.0-0 \
libcairo2 \
libasound2t64 \
&& rm -rf /var/lib/apt/lists/*

# Install GitHub CLI
RUN mkdir -p -m 755 /etc/apt/keyrings && \
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null && \
Expand Down Expand Up @@ -303,11 +327,11 @@ RUN chmod +x /usr/local/bin/generate-banner.sh && \
touch /home/catnip/.sudo_as_admin_successful && \
chown catnip:catnip /home/catnip/.sudo_as_admin_successful

# Install Claude Code and Gemini CLI as catnip user (not root)
# Install Claude Code, Gemini CLI, and Playwright MCP server as catnip user (not root)
USER catnip
RUN bash -c 'source /etc/profile.d/catnip.sh && \
source "$NVM_DIR/nvm.sh" && \
npm install -g @anthropic-ai/claude-code @google/gemini-cli && \
npm install -g @anthropic-ai/claude-code @google/gemini-cli @playwright/mcp && \
VSIX_PATH="$(npm root -g)/@anthropic-ai/claude-code/vendor/claude-code.vsix" && \
if [ -f "$VSIX_PATH" ]; then \
echo "Installing Claude Code extension from: $VSIX_PATH" && \
Expand All @@ -316,6 +340,11 @@ RUN bash -c 'source /etc/profile.d/catnip.sh && \
echo "Warning: Claude Code VSIX not found at $VSIX_PATH"; \
fi'

# Install Playwright browsers (chromium) as catnip user
RUN bash -c 'source /etc/profile.d/catnip.sh && \
source "$NVM_DIR/nvm.sh" && \
npx playwright install chromium'

# Set global git config for catnip user, these get overridden by the entrypoint script
RUN git config --global user.name "catnip" && \
git config --global user.email "catnip@catnip.run" && \
Expand All @@ -327,9 +356,10 @@ USER root



# Copy and set up entrypoint script
# Copy and set up entrypoint script and MCP configuration
COPY container/setup/entrypoint.sh /entrypoint.sh
COPY container/setup/setup-truecolor.sh /usr/local/bin/setup-truecolor.sh
COPY container/setup/.mcp.json /opt/catnip/setup/.mcp.json
RUN chmod +x /entrypoint.sh && \
chmod +x /usr/local/bin/setup-truecolor.sh && \
/usr/local/bin/setup-truecolor.sh
Expand Down
16 changes: 16 additions & 0 deletions container/setup/.mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"-y",
"@playwright/mcp",
"--headless",
"--browser",
"chromium",
"--no-sandbox"
],
"env": {}
}
}
}
6 changes: 6 additions & 0 deletions container/setup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ for config_dir in .ssh .aws .config .local .cargo .rustup; do
fi
done

# Copy MCP configuration for Claude Code if it exists
if [ -f "/opt/catnip/setup/.mcp.json" ]; then
echo "📋 Setting up MCP server configuration for Claude Code"
gosu 1000:1000 cp /opt/catnip/setup/.mcp.json /home/catnip/.mcp.json
fi

# Set git config for the catnip user (not root) and mark as safe repo
gosu 1000:1000 git config --global user.name "$GIT_USERNAME"
gosu 1000:1000 git config --global user.email "$GIT_EMAIL"
Expand Down
Loading