# Chrome DevTools MCP Server - Docker Image for Cloud Deployment
# Optimized for Koyeb free tier
FROM node:22-slim
# Install Chrome dependencies and Chromium
RUN apt-get update && apt-get install -y \
chromium \
chromium-sandbox \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxkbcommon0 \
libxrandr2 \
xdg-utils \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Set Puppeteer to skip downloading Chrome (we use system Chromium)
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Create app directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies (skip prepare script - needs source files)
RUN npm ci --ignore-scripts || npm install --ignore-scripts
# Copy source files
COPY . .
# Run prepare script and build the project
RUN npm run prepare && npm run build
# Expose the default port (Koyeb expects 8000)
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "fetch('http://localhost:8000/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
# Run the server in HTTP mode with headless Chrome
CMD ["node", "build/src/index.js", "--http", "--headless", "--port", "8000", "--host", "0.0.0.0", "--executablePath", "/usr/bin/chromium"]