diegobeyl/backtesting
2
1#!/bin/bash2 3# =============================================================================4# Docker Clean Script - Backtesting App V25# =============================================================================6# Removes all containers, volumes, and images7# =============================================================================8 9set -e10 11# Colors12RED='\033[0;31m'13GREEN='\033[0;32m'14YELLOW='\033[1;33m'15NC='\033[0m'16 17echo ""18echo "=========================================="19echo " Docker Cleanup"20echo "=========================================="21echo ""22echo -e "${YELLOW}⚠️ WARNING: This will remove:${NC}"23echo " - All containers"24echo " - All volumes (data will be lost!)"25echo " - All images"26echo ""27read -p "Are you sure? (yes/no): " confirm28 29if [ "$confirm" != "yes" ]; then30 echo "Cleanup cancelled"31 exit 032fi33 34echo ""35echo -e "${RED}🗑️ Cleaning up...${NC}"36 37# Stop and remove containers38docker-compose down -v39 40# Remove images41docker rmi backtesting-app-v2:latest 2>/dev/null || true42docker rmi backtesting-app-v2:dev 2>/dev/null || true43 44# Prune system45docker system prune -f46 47echo ""48echo -e "${GREEN}✅ Cleanup complete!${NC}"49echo ""50 