forked from syntaxbullet/aurorabot
feat: Overhaul Docker infrastructure with multi-stage builds, add a cleanup script, and refactor the update service to combine update and requirement checks.
This commit is contained in:
41
shared/scripts/docker-cleanup.sh
Executable file
41
shared/scripts/docker-cleanup.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# Cleanup script for Docker resources
|
||||
# Use: ./shared/scripts/docker-cleanup.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "🧹 Aurora Docker Cleanup"
|
||||
echo "========================"
|
||||
|
||||
# Stop running containers for this project
|
||||
echo ""
|
||||
echo "📦 Stopping Aurora containers..."
|
||||
docker compose down 2>/dev/null || true
|
||||
|
||||
# Remove dangling images (untagged images from failed builds)
|
||||
echo ""
|
||||
echo "🗑️ Removing dangling images..."
|
||||
docker image prune -f
|
||||
|
||||
# Optional: Remove unused build cache
|
||||
echo ""
|
||||
read -p "🔧 Remove Docker build cache? (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
docker builder prune -f
|
||||
echo "✓ Build cache cleared"
|
||||
fi
|
||||
|
||||
# Optional: Remove node_modules volumes (forces fresh install)
|
||||
echo ""
|
||||
read -p "📁 Remove node_modules volumes? (forces fresh install) (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
docker volume rm aurora_app_node_modules aurora_web_node_modules 2>/dev/null || true
|
||||
echo "✓ Node modules volumes removed"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ Cleanup complete!"
|
||||
echo ""
|
||||
echo "Run 'docker compose up --build' to rebuild"
|
||||
Reference in New Issue
Block a user