Home assistant core not connecting to mosquitto on restart

Hi guys, I have a Mac mini running docker with containers for mosquitto InfluxDB and Grafana

I installed home assistant via venv and I configured it to talk with the aforementioned container. Everything worked like a charm.

The problem is that on a reboot of the Mac mini everything start at it should but for some reason home assistant can not connect to mosquitto. I have some power plug talking with mosquitto and they reconnect immediately when the container with mosquitto is up and running but not HA, even after a restart from the interface. Any idea?
From the log i can see that home assistant try to connect to mosquito at startup but it finds nothing since docker is slower to get up and running.
It seems that after some failures HA doesen’t attempt to reconnect for some reason (even after a restart from the HA interface)

Currently the only way to make it work again is remove the mqtt integration in HA and set it back

See this post (solution is included)… Maybe HA is starting before Mosquitto is up.