Skip to content

Commit 3fe54fa

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 3fe54fa

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Use Node.js 22 LTS with Debian for Chrome compatibility
2+
FROM node:22-bookworm-slim
3+
4+
# Install Chrome dependencies
5+
RUN apt-get update && apt-get install -y \
6+
wget \
7+
gnupg \
8+
ca-certificates \
9+
fonts-liberation \
10+
libasound2 \
11+
libatk-bridge2.0-0 \
12+
libatk1.0-0 \
13+
libatspi2.0-0 \
14+
libcups2 \
15+
libdbus-1-3 \
16+
libdrm2 \
17+
libgbm1 \
18+
libgtk-3-0 \
19+
libnspr4 \
20+
libnss3 \
21+
libwayland-client0 \
22+
libxcomposite1 \
23+
libxdamage1 \
24+
libxfixes3 \
25+
libxkbcommon0 \
26+
libxrandr2 \
27+
xdg-utils \
28+
libu2f-udev \
29+
libvulkan1 \
30+
&& rm -rf /var/lib/apt/lists/*
31+
32+
# Install Chrome Stable
33+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg \
34+
&& sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
35+
&& apt-get update \
36+
&& apt-get install -y google-chrome-stable \
37+
&& rm -rf /var/lib/apt/lists/*
38+
39+
WORKDIR /app
40+
41+
# Copy package files
42+
COPY package*.json ./
43+
44+
# Install dependencies
45+
RUN npm ci --omit=dev
46+
47+
# Copy source files
48+
COPY . .
49+
50+
# Build the TypeScript project
51+
RUN npm run build
52+
53+
# Set environment to tell Puppeteer where Chrome is installed
54+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
55+
56+
# Run as non-root user for security
57+
RUN groupadd -r mcpuser && useradd -r -g mcpuser -G audio,video mcpuser \
58+
&& mkdir -p /home/mcpuser/Downloads \
59+
&& chown -R mcpuser:mcpuser /home/mcpuser \
60+
&& chown -R mcpuser:mcpuser /app
61+
62+
USER mcpuser
63+
64+
# Expose MCP server via stdio
65+
ENTRYPOINT ["node", "build/src/index.js"]

0 commit comments

Comments
 (0)