# FastMail MCP Server Dockerfile
# Multi-stage build for optimized container size
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies including devDependencies for build
RUN npm ci --only=production && npm cache clean --force
# Production stage
FROM node:20-alpine AS production
# Install dumb-init for proper signal handling
RUN apk add --no-cache dumb-init
# Create app user for security
RUN addgroup -g 1001 -S mcp && \
adduser -S mcp -u 1001
# Set working directory
WORKDIR /app
# Copy dependencies from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --chown=mcp:mcp package*.json ./
# Copy source code
COPY --chown=mcp:mcp src/ ./src/
# Create data directory for potential file operations
RUN mkdir -p /app/data && chown -R mcp:mcp /app/data
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Switch to non-root user
USER mcp
# Expose MCP stdio port (not actually used but good for documentation)
EXPOSE 3000
# Health check to ensure MCP server is responding
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "console.log('MCP server health check')" || exit 1
# Set environment variables
ENV NODE_ENV=production
ENV MCP_TRANSPORT=stdio
# Use dumb-init as entrypoint for proper signal handling
ENTRYPOINT ["dumb-init", "--"]
CMD ["/usr/local/bin/docker-entrypoint.sh"]
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gr3enarr0w/fastmail-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server