willfarrell / docker-autoheal

Monitor and restart unhealthy docker containers.
MIT License
1.31k stars 225 forks source link

Autoheal is healing ALL containers not just the ones with label #124

Closed addrum closed 8 months ago

addrum commented 8 months ago

Running autoheal with the following compose:

version: "3"
services:
  autoheal:
    image: willfarrell/autoheal
    container_name: autoheal
    environment:
      - PGID=65537
      - PUID=1029
      - TZ=Europe/London
    network_mode: bridge
    restart: always
    volumes:
      - /volume1/docker/docker.sock:/var/run/docker.sock

Have the following label as described in the readme defined on specific services:

    labels:
      - autoheal=true

Yet autoheal is also healing containers without the label above (can see so in the logs). Am I doing something wrong?

diegocade1 commented 8 months ago

you are missing one ENV for that to work on your autoheal stack:

image

addrum commented 8 months ago

@diegocade1 cheers, I've tried explicitly defining that too (though I think that's the default value anyway so shouldn't need to) but still the same issue 😔

addrum commented 8 months ago

Ah, I've just figured this out. It's not all, containers it's just auto healing https://github.com/haugene/docker-transmission-openvpn as it has the label set to true by default as described here.