Performance improvements: fix MCP server shutdown and disable caching

- Add proper shutdown handling for MCP servers
  - Listen for stdin EOF (main issue causing 6min delays)
  - Add transport.close() to properly close connections
  - Add 5-minute timeout safety net
  - Handle SIGHUP signal
- Disable Bun caching to avoid timeout errors
- Add Dockerfile.runner for pre-built container option
- Create optimized workflow example without container layer
This commit is contained in:
claude
2025-07-30 06:59:23 +00:00
parent 2972a854d4
commit 7944008493
4 changed files with 81 additions and 20 deletions

26
Dockerfile.runner Normal file
View File

@@ -0,0 +1,26 @@
FROM node:18-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
unzip \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install Bun globally
RUN curl -fsSL https://bun.sh/install | bash && \
ln -s /root/.bun/bin/bun /usr/local/bin/bun
# Pre-install Claude Code and dependencies
WORKDIR /opt/claude-action
COPY package.json bun.lockb* ./
RUN bun install --frozen-lockfile
# Install claude-code globally
RUN bun add -g @anthropic-ai/claude-code@1.0.62
# Set up environment
ENV PATH="/root/.bun/bin:${PATH}"
WORKDIR /workspace