.PHONY: build deploy verify clean restart logs help check-config

# 默认目标
help:
	@echo "Filament Admin 管理命令："
	@echo ""
	@echo "  build         构建 Docker 镜像（国内加速）"
	@echo "  deploy        部署应用到生产环境"
	@echo "  verify        验证部署状态"
	@echo "  check-config  检查配置和环境"
	@echo "  restart       重启应用"
	@echo "  logs          查看应用日志"
	@echo "  clean         清理资源"
	@echo "  stop          停止应用"
	@echo "  up            启动应用"
	@echo ""

# 检查配置
check-config:
	@echo "🔍 检查配置..."
	@./check-config.sh

# 构建镜像
build:
	@echo "🚀 开始构建镜像..."
	@./build.sh

# 部署应用
deploy:
	@echo "🚀 部署应用..."
	@./deploy.sh

# 验证部署
verify:
	@echo "🔍 验证部署状态..."
	@./verify.sh

# 重启应用
restart:
	@echo "🔄 重启应用..."
	@docker compose restart

# 查看日志
logs:
	@echo "📜 查看日志..."
	@docker compose logs -f

# 清理资源
clean:
	@echo "🧹 清理 Docker 资源..."
	@docker compose down -v
	@docker system prune -f

# 停止应用
stop:
	@echo "⏹️  停止应用..."
	@docker compose down

# 启动应用
up:
	@echo "▶️  启动应用..."
	@docker compose up -d
