Files
codimd/cleanup.sh
Timmy 9ea9eb4b61 feat: add comprehensive management scripts for CodiMD
Add 9 management scripts to simplify CodiMD operations:
- start.sh: Start services with automatic .env setup
- stop.sh: Stop all services gracefully
- restart.sh: Restart all services
- logs.sh: View real-time logs for any service
- status.sh: Check service status and resource usage
- backup.sh: Backup database, uploads, and environment
- restore.sh: Restore from backups with interactive selection
- update.sh: Update Docker images with automatic backup
- cleanup.sh: Clean unused Docker resources

Add SCRIPTS.md with comprehensive usage documentation and examples.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-03-17 17:41:10 +08:00

32 lines
604 B
Bash
Executable File

#!/bin/bash
# CodiMD 清理腳本
set -e
echo "🧹 清理 Docker 資源..."
echo ""
# 1. 清理未使用的映像
echo "🗑️ 清理未使用的 Docker 映像..."
docker image prune -f
# 2. 清理未使用的容器
echo "🗑️ 清理停止的容器..."
docker container prune -f
# 3. 清理未使用的網路
echo "🗑️ 清理未使用的網路..."
docker network prune -f
# 4. 清理建置快取
echo "🗑️ 清理建置快取..."
docker builder prune -f
echo ""
echo "✅ 清理完成!"
echo ""
# 顯示釋放的空間
echo "💾 目前 Docker 磁碟使用:"
docker system df