#!/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"