feat: Add context7-mcp with custom Dockerfile
- Create dockerfiles/context7/Dockerfile for monorepo build - Update docker-compose.yml to use custom Dockerfile context - Build approach: copy all source, then pnpm install workspaces, then build:mcp - Requires UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN env vars - Follows AGENTS.md guidelines for Dockerfile management Note: Monorepo structure requires full source copy before dependency resolution to properly install workspace dependencies across packages/mcp, packages/sdk, etc.
This commit is contained in:
@@ -144,13 +144,12 @@ services:
|
|||||||
context7-mcp:
|
context7-mcp:
|
||||||
build:
|
build:
|
||||||
context: ./vendor/context7
|
context: ./vendor/context7
|
||||||
dockerfile: Dockerfile
|
dockerfile: ../../dockerfiles/context7/Dockerfile
|
||||||
container_name: KNELDevStack-AIMiddleware-context7-mcp
|
container_name: KNELDevStack-AIMiddleware-context7-mcp
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- UPSTASH_REDIS_REST_URL=${UPSTASH_REDIS_REST_URL}
|
- UPSTASH_REDIS_REST_URL=${UPSTASH_REDIS_REST_URL}
|
||||||
- UPSTASH_REDIS_REST_TOKEN=${UPSTASH_REDIS_REST_TOKEN}
|
- UPSTASH_REDIS_REST_TOKEN=${UPSTASH_REDIS_REST_TOKEN}
|
||||||
command: ["node", "packages/mcp/dist/index.js", "--transport", "stdio"]
|
|
||||||
profiles:
|
profiles:
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
|
|||||||
19
dockerfiles/context7/Dockerfile
Normal file
19
dockerfiles/context7/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
FROM node:22-alpine
|
||||||
|
|
||||||
|
# Install pnpm for monorepo
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy all source first
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install all workspace dependencies (from within source tree)
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
|
# Build MCP package specifically
|
||||||
|
RUN pnpm build:mcp
|
||||||
|
|
||||||
|
# Set entrypoint to run MCP server
|
||||||
|
ENTRYPOINT ["node", "packages/mcp/dist/index.js"]
|
||||||
|
CMD ["--transport", "stdio"]
|
||||||
Reference in New Issue
Block a user