Files
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 12:41:06 +08:00

55 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Analyze potential optimization savings
echo "🔍 Analyzing Docker Optimization Potential"
echo "=========================================="
# Check current database size
if [ -f data/nodes.db ]; then
DB_SIZE=$(du -h data/nodes.db | cut -f1)
echo "Current database size: $DB_SIZE"
fi
# Check node_modules size
if [ -d node_modules ]; then
echo -e "\n📦 Package sizes:"
echo "Total node_modules: $(du -sh node_modules | cut -f1)"
echo "n8n packages:"
for pkg in n8n n8n-core n8n-workflow @n8n/n8n-nodes-langchain; do
if [ -d "node_modules/$pkg" ]; then
SIZE=$(du -sh "node_modules/$pkg" 2>/dev/null | cut -f1 || echo "N/A")
echo " - $pkg: $SIZE"
fi
done
fi
# Check runtime dependencies
echo -e "\n🎯 Runtime-only dependencies:"
RUNTIME_DEPS="@modelcontextprotocol/sdk better-sqlite3 sql.js express dotenv"
RUNTIME_SIZE=0
for dep in $RUNTIME_DEPS; do
if [ -d "node_modules/$dep" ]; then
SIZE=$(du -sh "node_modules/$dep" 2>/dev/null | cut -f1 || echo "0")
echo " - $dep: $SIZE"
fi
done
# Estimate savings
echo -e "\n💡 Optimization potential:"
echo "- Current image: 2.61GB"
echo "- Estimated optimized: ~200MB"
echo "- Savings: ~92%"
# Show what would be removed
echo -e "\n🗑️ Would remove in optimization:"
echo "- n8n packages (>2GB)"
echo "- Build dependencies"
echo "- Documentation files"
echo "- Test files"
echo "- Source maps"
# Check if optimized database exists
if [ -f data/nodes-optimized.db ]; then
OPT_SIZE=$(du -h data/nodes-optimized.db | cut -f1)
echo -e "\n✅ Optimized database exists: $OPT_SIZE"
fi