Alexa + Emulate Hue in Docker with Port 80 already in use

I am having difficulties getting my Echo Dots to discover the emulated Hue after migrating to a Docker container.

It seems that based on other threads I need to add listen_port: 80 to my emulated_hue: (Docker Emulated Hue UPNP not working) config but that will conflict with my PiHole container that requires port 80.

Does anyone have any ideas on how to get this working? Do I need to expose more ports to the container? I would like to avoid network_mode: host if at all possible. Is there something I can do with my reverse proxy to fix this (I’m using Traefik)?

Current yaml that generates http://<dockerhostIP>:8300/description.xml and http://<dockerhostIP>:8300/api/pi/lights

emulated_hue:
  advertise_ip: !secret docker_host_ip
  listen_port: 8300
  advertise_port: 8300
  upnp_bind_multicast: true
  expose_by_default: false
  exposed_domains:
    - light
  entities:
    light.entry_light_level:
      name: "Entry Way Light"
      hidden: false

docker-config.yml for homeassistant:

    ports:
      - 8123:8123 # Web
      - 8300:8300 # Emulated_hue
      - 51827:51827 # HomeKit

And the PiHole config

docker run -d \
    --name pihole --hostname pihole \
    -p 53:53/tcp -p 53:53/udp \
    -p 67:67/udp \
    -p 80:80 \
    -p 443:443 \

Echos uses 8300 like you already have in your config, unnecessarily as it’s the default, port 80 was for Google Home.

@Bobby_Nobble,

I had thrown them in just to make sure as nothing was working.

I now think I know what the issue may be, when configuring the ports by network_mode: host, the listening is port is IPv4 and if I expose the ports the listening local address is IPv6.

network_mode: host

$ sudo netstat -lptn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN      22310/python3       
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      336/systemd-resolve 
tcp        0      0 Dockerhost_IPV4:8300    0.0.0.0:*               LISTEN      22310/python3       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      395/sshd            
tcp6       0      0 :::1883                 :::*                    LISTEN      9458/docker-proxy   
tcp6       0      0 :::5355                 :::*                    LISTEN      336/systemd-resolve  
tcp6       0      0 :::22                   :::*                    LISTEN      395/sshd            

And by configuring ports:

    networks:
      - default
    ports:
      - 8123:8123 # Web
      - 8300:8300 # Emulated_hue
      - 51827:51827 # HomeKit
#    network_mode: host
$ sudo netstat -lptn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      336/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      395/sshd            
tcp6       0      0 :::8123                 :::*                    LISTEN      24203/docker-proxy  
tcp6       0      0 :::1883                 :::*                    LISTEN      9458/docker-proxy   
tcp6       0      0 :::5355                 :::*                    LISTEN      336/systemd-resolve 
tcp6       0      0 :::8300                 :::*                    LISTEN      24191/docker-proxy  
tcp6       0      0 :::51827                :::*                    LISTEN      24177/docker-proxy  
tcp6       0      0 :::22                   :::*                    LISTEN      395/sshd            

Hmmmm. :thinking: Could that be the reason why the Dot’s cannot discover the devices? After changeing back to exposing ports (as network_mode: host broke my reverse proxy config) the lights still work.

That means this is only related to discovery.