- Use fs.realpathSync for entry point detection to fix npx symlink failures - Add --help and --version CLI flags with explicit process.exit(0) - Add TTY detection in setup wizard to prevent non-interactive hangs - Wrap JSON.parse in mergeJsonConfig with try/catch for malformed configs - Update engines.node to >=20.0.0 to match better-sqlite3 requirements - Update Dockerfiles from node:18-slim to node:20-slim - Remove error-swallowing || true from postinstall script - Replace deprecated windows-build-tools with VS Build Tools link
49 lines
1.4 KiB
Docker
49 lines
1.4 KiB
Docker
# Dockerfile for MCP Excalidraw Server
|
|
# Builds the MCP server with SQLite persistence
|
|
|
|
# Stage 1: Build backend (TypeScript compilation + native modules)
|
|
FROM node:20-slim AS builder
|
|
|
|
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN --mount=type=cache,target=/root/.npm npm ci
|
|
|
|
COPY src ./src
|
|
COPY tsconfig.json ./
|
|
RUN npm run build:server
|
|
|
|
# Stage 2: Production MCP Server
|
|
FROM node:20-slim AS production
|
|
|
|
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN addgroup --system --gid 1001 nodejs && \
|
|
adduser --system --uid 1001 --gid 1001 nodejs
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
|
|
|
|
# Remove build tools after native modules are compiled
|
|
RUN apt-get purge -y python3 make g++ && apt-get autoremove -y
|
|
|
|
COPY --from=builder /app/dist ./dist
|
|
|
|
RUN mkdir -p /app/data && chown -R nodejs:nodejs /app
|
|
USER nodejs
|
|
|
|
ENV NODE_ENV=production
|
|
ENV EXPRESS_SERVER_URL=http://localhost:3000
|
|
ENV ENABLE_CANVAS_SYNC=true
|
|
ENV EXCALIDRAW_DB_PATH=/app/data/excalidraw.db
|
|
|
|
CMD ["node", "dist/index.js"]
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/sanjibdevnathlabs/mcp-excalidraw-local"
|
|
LABEL org.opencontainers.image.description="MCP Excalidraw Server - Model Context Protocol for AI agents (with SQLite persistence & multi-tenancy)"
|
|
LABEL org.opencontainers.image.licenses="MIT"
|