After a couple hours of searching, and a couple more of testing. I need help.
I am trying to start with a fresh install of home assistant in a portainer stack that will include multiple other containers including maria db, frigate, vscode, hass-configurator (until I can figure out if I can get the HA config yaml setup on the vscode container), and more.
The challenge is I’d like to conform to a sequential port schema which requires me to change the listening port for each container either through port mapping 8011:#### or through changing the listening port through environment variables (preferred)
I am aware that HTTP - Home Assistant exists and have updated my configuration.yaml to account for that. However, nothing I change the port to in the yaml file seems to work with the recommended network_mode: host
container compose setting. Attempting to browse to host-ip:new_port
just results in a timeout.
The only way I can get the port I want to work is by disabling network_mode: host and adding port: 8011:8011
in the portainer stack/ docker compose. Judging from that the config yaml change is doing something, but it’s not overriding whatever allows 8123 to work with network_mode: host enabled.
So what do I do here? Just run HA at 8011 without network_mode: host enabled? What are the impacts of that?
config yaml
# Loads default set of integrations. Do not remove.
default_config:
# Example HTTP configuration.yaml entry https://www.home-assistant.io/integrations/http/
http:
server_port: 8011 #12345
The below works perfectly fine with port 8123
homeassistant:
#container_name: hass
image: homeassistant/home-assistant
environment:
- PUID=1000
- PGID=1000
volumes:
- /home/example/config:/config #./hass-config:/config
- /nfs/examplemedia:/media
- /nfs/examplenvr_maybe_for_frigate/nvr_capture:/nvr_capture
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
network_mode: host
Only working compose setup to actually change/ access HA at port other than 8123
#version: '3'
#services:
homeassistant:
#container_name: hass
image: homeassistant/home-assistant
environment:
- PUID=1000
- PGID=1000
volumes:
- /home/example/config:/config #./hass-config:/config
- /nfs/examplemedia:/media
- /nfs/examplenvr_maybe_for_frigate/nvr_capture:/nvr_capture
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
#network_mode: host
#expose:
#- 8011
ports:
- 8011:8011