computer-playbook/roles/sys-ctl-rpr-docker-soft
Kevin Veen-Birkenbach 9756a0f75f
Extend repair scripts with env-file support and unit tests
- Added detect_env_file() to both sys-ctl-rpr-docker-soft and sys-ctl-rpr-docker-hard
  * prefer .env, fallback to .env/env
  * append --env-file parameter automatically
- Refactored soft script to use compose_cmd() for consistent command building
- Adjusted error recovery path in soft script to also respect env-file
- Extended unit tests for soft script to cover env-file priority and restart commands
- Added new unit tests for hard script verifying env-file priority, cwd handling,
  and --only filter logic

Ref: https://chatgpt.com/share/68ad7b30-7510-800f-8172-56f03a2f40f5
2025-08-26 11:15:59 +02:00
..

Docker Healer 🩺

Description

This Ansible role automatically restarts Docker Compose configurations with exited or unhealthy containers on Arch Linux systems. It ensures the stability of containerized workloads by recovering from common error conditions like port binding issues.

Overview

Tailored for Arch Linux, this role monitors containers for failure states and initiates a controlled restart of affected Compose configurations. If port conflicts prevent recovery, the role stops the affected stack, restarts Docker, and recreates the container environment.

Purpose

The purpose of this role is to provide automated healing for Docker Compose environments, minimizing manual recovery effort and reducing downtime.

Features

  • Container Health Monitoring: Detects unhealthy or exited containers.
  • Automated Recovery: Restarts failed containers and resolves port binding issues.
  • Run-once Setup Logic: Ensures idempotent execution by controlling task flow with internal flags.
  • System Role Integration: Seamlessly integrates with Infinito.Nexus system maintenance logic.

Credits 📝

Developed and maintained by Kevin Veen-Birkenbach.
Learn more at www.veen.world

Part of the Infinito.Nexus Project
License: Infinito.Nexus NonCommercial License