409e92d6ae
Build and Push Docker Images / Build Docker Image (push) Has been cancelled
Build and Push Docker Images / Build Railway Docker Image (push) Has been cancelled
Build and Publish n8n Docker Image / test-image (push) Has been cancelled
Dependency Compatibility Check / Fresh Install Dependency Check (push) Has been cancelled
Build and Publish n8n Docker Image / build-and-push (push) Has been cancelled
Build and Publish n8n Docker Image / create-release (push) Has been cancelled
Automated Release / Detect Version Change (push) Has been cancelled
Automated Release / Generate Release Notes (push) Has been cancelled
Automated Release / Create GitHub Release (push) Has been cancelled
Automated Release / Package MCPB Bundle (push) Has been cancelled
Automated Release / Build and Verify (push) Has been cancelled
Automated Release / Publish to NPM (push) Has been cancelled
Automated Release / Build and Push Docker Images (push) Has been cancelled
Automated Release / Update Documentation (push) Has been cancelled
Automated Release / Notify Release Completion (push) Has been cancelled
Secret Scan / secretlint (push) Has been cancelled
Test Suite / test (push) Has been cancelled
Test Suite / cjs-runtime (push) Has been cancelled
Test Suite / publish-results (push) Has been cancelled
70 lines
2.0 KiB
Bash
Executable File
70 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Demonstrate the optimization concept
|
|
|
|
echo "🎯 Demonstrating Docker Optimization"
|
|
echo "===================================="
|
|
|
|
# Create a demo directory structure
|
|
DEMO_DIR="optimization-demo"
|
|
rm -rf $DEMO_DIR
|
|
mkdir -p $DEMO_DIR
|
|
|
|
# Copy only runtime files
|
|
echo -e "\n📦 Creating minimal runtime package..."
|
|
cat > $DEMO_DIR/package.json << 'EOF'
|
|
{
|
|
"name": "n8n-mcp-optimized",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"main": "dist/mcp/index.js",
|
|
"dependencies": {
|
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
"better-sqlite3": "^11.10.0",
|
|
"sql.js": "^1.13.0",
|
|
"express": "^5.1.0",
|
|
"dotenv": "^16.5.0"
|
|
}
|
|
}
|
|
EOF
|
|
|
|
# Copy built files
|
|
echo "📁 Copying built application..."
|
|
cp -r dist $DEMO_DIR/
|
|
cp -r data $DEMO_DIR/
|
|
mkdir -p $DEMO_DIR/src/database
|
|
cp src/database/schema*.sql $DEMO_DIR/src/database/
|
|
|
|
# Calculate sizes
|
|
echo -e "\n📊 Size comparison:"
|
|
echo "Original project: $(du -sh . | cut -f1)"
|
|
echo "Optimized runtime: $(du -sh $DEMO_DIR | cut -f1)"
|
|
|
|
# Show what's included
|
|
echo -e "\n✅ Optimized package includes:"
|
|
echo "- Pre-built SQLite database with all node info"
|
|
echo "- Compiled JavaScript (dist/)"
|
|
echo "- Minimal runtime dependencies"
|
|
echo "- No n8n packages needed!"
|
|
|
|
# Create a simple test
|
|
echo -e "\n🧪 Testing database content..."
|
|
if command -v sqlite3 &> /dev/null; then
|
|
NODE_COUNT=$(sqlite3 data/nodes.db "SELECT COUNT(*) FROM nodes;" 2>/dev/null || echo "0")
|
|
AI_COUNT=$(sqlite3 data/nodes.db "SELECT COUNT(*) FROM nodes WHERE is_ai_tool = 1;" 2>/dev/null || echo "0")
|
|
echo "- Total nodes in database: $NODE_COUNT"
|
|
echo "- AI-capable nodes: $AI_COUNT"
|
|
else
|
|
echo "- SQLite CLI not installed, skipping count"
|
|
fi
|
|
|
|
echo -e "\n💡 This demonstrates that we can run n8n-MCP with:"
|
|
echo "- ~50MB of runtime dependencies (vs 1.6GB)"
|
|
echo "- Pre-built database (11MB)"
|
|
echo "- No n8n packages at runtime"
|
|
echo "- Total optimized size: ~200MB (vs 2.6GB)"
|
|
|
|
# Cleanup
|
|
echo -e "\n🧹 Cleaning up demo..."
|
|
rm -rf $DEMO_DIR
|
|
|
|
echo -e "\n✨ Optimization concept demonstrated!" |