Fail2ban configuration for a Home Assistant all in docker environment

I have my home assistant running as a docker container and exposed it through a nginx reverse proxy (docker container).
Now I want to setup fail2ban also as a docker container - preferred with docker-compose.

I wonder, if someone has a similar setup and can share the fail2ban docker-compose.yaml as well as the fail2ban configuration files.

Am I right, that fail2ban just scans the /config/home-assistant.log file to detect failed logins?

 Login attempt or request with invalid authentication from 172.18.0.2 (172.18.0.2). ...

Did you ever succeded in doing this?
Thanks

May I ask, what’s the significance of fail2ban?

If you wanted to ban multiple login attempts from a given ip automatically, you could use this:

Edit: Nevermind I got the gist now - would be powerful to have one container to manage all bans across multiple systems at network gateway level.