Files
n8n-mcp/Dockerfile
czlonkowski 1dd6b8e55f Clean up legacy documentation and scripts
- Remove all references to workflow execution/management features
- Delete legacy scripts for bidirectional n8n integration
- Update documentation to focus on node documentation serving only
- Remove old docker-compose files for workflow management
- Add simplified docker-compose.yml for documentation server
- Update CHANGELOG.md to reflect v2.0.0 and v2.1.0 changes
- Update Dockerfile to use v2 paths and database

The project is now clearly focused on serving n8n node documentation
to AI assistants, with no workflow execution capabilities.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 07:54:53 +00:00

54 lines
1.3 KiB
Docker

# Production stage
FROM node:18-alpine
# Install SQLite (for database management)
RUN apk add --no-cache sqlite
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production
# Copy built files
COPY dist ./dist
COPY tests ./tests
# Create data directory for SQLite database
RUN mkdir -p /app/data
# Create a non-root user
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
# Change ownership (including data directory)
RUN chown -R nodejs:nodejs /app
# Switch to non-root user
USER nodejs
# Set environment variable for database location
ENV NODE_DB_PATH=/app/data/nodes-v2.db
# Create a startup script
RUN printf '#!/bin/sh\n\
echo "🚀 Starting n8n Documentation MCP server..."\n\
\n\
# Initialize database if it does not exist\n\
if [ ! -f "$NODE_DB_PATH" ]; then\n\
echo "📦 Initializing database..."\n\
node dist/scripts/rebuild-database-v2.js\n\
fi\n\
\n\
echo "🎯 Database ready, starting documentation server..."\n\
exec node dist/index-v2.js\n' > /app/start.sh && chmod +x /app/start.sh
# Expose the MCP server port (if using HTTP transport)
EXPOSE 3000
# Volume for persistent database storage
VOLUME ["/app/data"]
# Start the MCP server with database initialization
CMD ["/bin/sh", "/app/start.sh"]