feat: dedicated auto-healing agent — sidecar container + pi agent definition
- auto-healer/Dockerfile: lightweight Alpine container with Docker CLI - auto-healer/auto-heal-agent.sh: real-time fault detection + remediation engine - Detects: crash, OOM, DB disconnect, gateway down, disk pressure - Fixes: restart, rollback, nginx reload, prune, escalate - Sliding window restart tracking (3/hr max) - auto-healer/docker-compose.healer.yml: sidecar deployment config - Mounts Docker socket for event monitoring - Host network mode for health checks - Persistent state in /var/state/falah - .pi/agents/auto-healer.md: pi agent definition for manual invocation
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# ── Falah Mobile — Auto-Healer Agent ──────────────────────────
|
||||
# Dedicated container that monitors the app stack and auto-fixes faults.
|
||||
# Runs alongside the main app container with access to Docker socket.
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apk add --no-cache curl docker-cli bash jq
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY auto-heal-agent.sh /app/auto-heal-agent.sh
|
||||
RUN chmod +x /app/auto-heal-agent.sh
|
||||
|
||||
# Runtime state
|
||||
RUN mkdir -p /var/log/falah /var/state/falah
|
||||
|
||||
# Monitor interval in seconds (default 30)
|
||||
ENV CHECK_INTERVAL=30
|
||||
ENV CONTAINER_NAME=falah-mobile-staging
|
||||
ENV HEALTH_URL=http://localhost:4014/mobile/api/health
|
||||
ENV GATEWAY_URL=http://localhost:7878/mobile/api/health
|
||||
ENV MAX_RESTARTS_PER_HOUR=3
|
||||
|
||||
CMD ["/app/auto-heal-agent.sh"]
|
||||
Reference in New Issue
Block a user