Skip to content

Commit ca14ab8

Browse files
committed
Add Dockerfile for MCP registry support
This Dockerfile enables the chrome-devtools-mcp server to be used with Docker-based MCP registries. It: - Uses Node.js 22 LTS with Chrome dependencies - Installs Chrome Stable for Puppeteer - Builds the TypeScript project - Runs as non-root user for security - Exposes the MCP server via stdio
1 parent c3784d1 commit ca14ab8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Use Node.js 22 LTS with Debian for Chrome compatibility
2+
FROM node:22-bookworm-slim
3+
4+
# Install Chromium and dependencies
5+
RUN apt-get update && apt-get install -y \
6+
chromium \
7+
fonts-liberation \
8+
libasound2 \
9+
libatk-bridge2.0-0 \
10+
libatk1.0-0 \
11+
libatspi2.0-0 \
12+
libcups2 \
13+
libdbus-1-3 \
14+
libdrm2 \
15+
libgbm1 \
16+
libgtk-3-0 \
17+
libnspr4 \
18+
libnss3 \
19+
libwayland-client0 \
20+
libxcomposite1 \
21+
libxdamage1 \
22+
libxfixes3 \
23+
libxkbcommon0 \
24+
libxrandr2 \
25+
xdg-utils \
26+
&& rm -rf /var/lib/apt/lists/*
27+
28+
WORKDIR /app
29+
30+
# Copy package files
31+
COPY package*.json ./
32+
33+
# Install dependencies
34+
RUN npm ci --omit=dev
35+
36+
# Copy source files
37+
COPY . .
38+
39+
# Build the TypeScript project
40+
RUN npm run build
41+
42+
# Set environment to tell Puppeteer where Chromium is installed
43+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
44+
45+
# Run as non-root user for security
46+
RUN groupadd -r mcpuser && useradd -r -g mcpuser -G audio,video mcpuser \
47+
&& mkdir -p /home/mcpuser/Downloads \
48+
&& chown -R mcpuser:mcpuser /home/mcpuser \
49+
&& chown -R mcpuser:mcpuser /app
50+
51+
USER mcpuser
52+
53+
# Expose MCP server via stdio
54+
ENTRYPOINT ["node", "build/src/index.js"]

0 commit comments

Comments
 (0)