feat: add tiered startup ordering to first-boot containers

- Tier 1: Databases & Core Infrastructure (Bitcoin, MariaDB, Postgres)
- Tier 2: Core Services (LND, Fedimint) with 5s stabilization delay
- Tier 3: Applications (Home Assistant, Grafana, etc.) with 5s delay
- Matches health_monitor.rs StartupTier approach

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-14 03:06:20 +00:00
parent a9624f3fe6
commit f9272650c4
2 changed files with 12 additions and 1 deletions

View File

@@ -62,6 +62,9 @@ fi
# Ensure network exists (matches deploy)
$DOCKER network create archy-net 2>/dev/null || true
# ── Tier 1: Databases & Core Infrastructure ──────────────────────────────
log "=== Tier 1: Databases & Core Infrastructure ==="
# 1. Bitcoin Knots (matches deploy exactly)
if ! $DOCKER ps --format '{{.Names}}' 2>/dev/null | grep -qE 'bitcoin-knots|archy-bitcoin-knots'; then
log "Creating Bitcoin Knots..."
@@ -202,6 +205,10 @@ if ! $DOCKER ps --format '{{.Names}}' 2>/dev/null | grep -q btcpay-server; then
docker.io/btcpayserver/btcpayserver:1.13.5 2>>"$LOG" || true
fi
# ── Tier 2: Core Services ─────────────────────────────────────────────────
log "=== Tier 2: Core Services ==="
sleep 5 # Let databases stabilize
# 4. LND
if ! $DOCKER ps --format '{{.Names}}' 2>/dev/null | grep -qE '^lnd$'; then
log "Creating LND..."
@@ -296,6 +303,10 @@ if ! $DOCKER ps --format '{{.Names}}' 2>/dev/null | grep -q fedimint-gateway; th
fi
fi
# ── Tier 3: Applications ──────────────────────────────────────────────────
log "=== Tier 3: Applications ==="
sleep 5 # Let core services stabilize
# 6. Home Assistant
if ! $DOCKER ps --format '{{.Names}}' 2>/dev/null | grep -qE 'homeassistant|home-assistant'; then
log "Creating Home Assistant..."