Hi everyone,
I recently moved my Home Assistant to docker, specifically docker-compose.
In the beginning I didn’t specify my network_mode in the docker-compose file, but just exposed port 8123.
There was no problem in accessing the Home Assistant frontend on my local-ip:8123.
I wanted to add my cast devices, but Google Cast didn’t show up in the integrations as it could not be discovered. After reading a few topics here, I discovered this had to do with the network_mode. This needed to be ‘host’ so auto-discovery could work.
Now I cant reach my frontend anymore… What do I need to do ? I can reach my mariaDB, and my node-red workflow.
My docker-compose file:
version: '3'
services:
# HomeAssistant
homeassistant:
image: homeassistant/home-assistant:stable
volumes:
- homeassistant:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
network_mode: host
privileged: true
depends_on:
- mariadb
# user: ${LOCAL_USER}:${LOCAL_USER}
# devices:
# - "/dev/ttyACM0:/dev/ttyACM0"
# MariaDB
mariadb:
image: mariadb/server:10.4
volumes:
- mariadb:/var/lib/mysql
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=ha_db
- MYSQL_USER=homeassistant
- MYSQL_PASSWORD=${HA_MYSQL_PASSWORD}
restart: unless-stopped
# NodeRed
nodered:
image: nodered/node-red:1.2.1
volumes:
- nodered:/data
ports:
- 1880:1880
restart: unless-stopped
depends_on:
- homeassistant
# user: '${LOCAL_USER}:${LOCAL_USER}'
environment:
- TZ=Europe/Brussels
volumes:
homeassistant:
nodered:
mariadb:
I found this link to the official docs of docker, saying that network_mode only works on Linux hosts. I have a windows desktop with docker/docker-compose installed with WSL 2 (ubuntu 20). Am I running a linux host or is the windows my host ?
TIA,
Greetz Bert