I am running HA (not hassio) on an intel Nuc using docker, with some additional stuff like influxdb, grafana and nodered. Additionally, I am using Traefik as a reverse proxy, which is where I run into issues.
When I configure HA in docker-compose with the networks: option, to make it part of the traefik_proxy network I have setup, I can access HA on the specified domain. But, auto-discovery does not work in HA, nor can it find chromecast or sonos devices I have in my house.
When I remove the networks: part and replace it with “network_mode: host”, auto-discovery works, and it finds all devices on my network. But traefik no longer seems to be able to connect frontend to backend. I notice in the first setup, the home assistant backend has an IP address in the docker network range, and in the host network mode, the backend has IP 127.0.0.1, all seems ok, but it won’t route correctly.
I am not sure how to debug this, anybody have a guess where I am screwing things up?
good catch @ha_steve, have read over those lines dozens of times and got blind to it I guess However, when I set it to =host, no homeassistant backend shows up at all in traefik, and if I leave out the label completely, the backend shows up, but still traffic is not correctly routed to the backend. From the traefik documentation, I get none the wiser, have you got any tips?
I have copied over most your settings and adapted to my domain, but no luck so far. Does your frontend/backend settings in Traefik look similar to this?
I notice you run traefik in host network mode as well. Assuming you have more services defined in your docker-compose (maybe influxdb and grafana), do you run all of those in network_mode host then?
I have a total of 8 containers I run behind Traefik, HA is the only one I run in host mode (for the same reason you want to use host mode) and the rest I just forward the port to the container. I have never set up a network for them.
Correct. When you follow the guide then discovery won’t work. You have to remove the traefik labels, add network mode “host” and edit your traefik.toml
Tx again Piotr, conclusion I’m not stupid just have tried to copy something that wont work with discovery function. A little bit funny though, been using Nginx before but your comment about traefik made me change it is easier but was frustrated when discovery didn’t work
I have various sonos speakers, but have focused on trying to send tts to a sonos beam, the difference in my setup is I have two pc’s - 1 running docker with traefik & the other running home assistant - both on the same network and using the traefik backend to send data.
the sonos never “speaks” the tts, after much testing I can only assume its something to do with the traefik setup - but I have the traefik.toml backend setup as you described…only difference being there is no docker-compose entry as it runs on a different pc which runs hassio docker on ubuntu server.
I use letsencrypt and have a registered domain, everything else works great inc the IOS app using these details.
I thought maybe there was a particular encryption type I needed to add to traefik for it to work with sonos…but am at a loss.
Any help very much appreciated
have this in docker-compose:
networks:
traefik_proxy:
external:
name : traefik_proxy
default:
driver: bridge
and the same [backends] as quoted with my details.
What exact problem are you trying to solve ? I have configure HA as a non-docker service in Traefik.toml (I’m on Traefik 1.7, 2.0 is a whole different story)