mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 00:41:26 +02:00
feat(mac-mini): add auto-start and management scripts
- setup-autostart.sh: Configure launchd services for boot - startup.sh: Main startup script (waits for Docker, starts containers) - health-check.sh: Check all services (runs every 5 min) - status.sh: Full system status overview - restart.sh: Restart containers (with --pull and --force options) - stop.sh: Stop all containers gracefully - README.md: Complete documentation Includes optional ntfy.sh push notifications for health check failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2164d4afa0
commit
93060dc335
7 changed files with 843 additions and 0 deletions
69
scripts/mac-mini/restart.sh
Executable file
69
scripts/mac-mini/restart.sh
Executable file
|
|
@ -0,0 +1,69 @@
|
|||
#!/bin/bash
|
||||
# ManaCore Mac Mini Restart Script
|
||||
# Restarts all Docker containers gracefully
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
COMPOSE_FILE="$PROJECT_ROOT/docker-compose.macmini.yml"
|
||||
ENV_FILE="$PROJECT_ROOT/.env.macmini"
|
||||
|
||||
echo "=== ManaCore Restart ==="
|
||||
echo ""
|
||||
|
||||
# Check for flags
|
||||
PULL_IMAGES=false
|
||||
FORCE_RECREATE=false
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
--pull) PULL_IMAGES=true ;;
|
||||
--force) FORCE_RECREATE=true ;;
|
||||
--help)
|
||||
echo "Usage: restart.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --pull Pull latest images before restart"
|
||||
echo " --force Force recreate containers"
|
||||
echo " --help Show this help"
|
||||
exit 0
|
||||
;;
|
||||
*) echo "Unknown option: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Optional: Pull latest images
|
||||
if [ "$PULL_IMAGES" = true ]; then
|
||||
echo "Pulling latest images..."
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" pull
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Stop containers
|
||||
echo "Stopping containers..."
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" down
|
||||
|
||||
echo ""
|
||||
echo "Starting containers..."
|
||||
|
||||
if [ "$FORCE_RECREATE" = true ]; then
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d --force-recreate
|
||||
else
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Waiting for services to start (30s)..."
|
||||
sleep 30
|
||||
|
||||
echo ""
|
||||
echo "=== Container Status ==="
|
||||
docker compose -f "$COMPOSE_FILE" ps
|
||||
|
||||
echo ""
|
||||
echo "Running health check..."
|
||||
"$SCRIPT_DIR/health-check.sh"
|
||||
Loading…
Add table
Add a link
Reference in a new issue