Hello
I am running HA as a container under Ubuntu (configuration details below), with port 80 mapped to 8123 so I can use the UI without typing the port number in the URL.
System is set to start the HA container with a service using docker-compose (compose file below).
Everything seems to work fine but I am facing a weird situation I cannot explain: sometimes, the HA service fails to start, but the UI is still working (!).
- when restarting the service (
systemctl restart
), the HA container fails to start because port 80 is in use (the container remains in Created state) - the process that owns the port is
python3 -m homeassistant --config /config
(apparently running on the host) - the parent process of the
python3
process iss6-supervise home-assistant
- a new
python3
process appears each time I kill it - command
docker ps -a
is not showing any other container
I had a hard time installing HACS because the procedure I followed required unzipping the package from within the container (using docker exec
), which therefore must be running. At one point I was able to start the container (not sure how, maybe when I tried without the port mapping), but I find that my setup is not very stable.
Can someone explain what is going on? Am I doing something wrong? I suspect this might have something to do with ‘snap’, but it’s just a wild guess.
Cheers,
JC
- Minisforum N40 (Celeron N4020) + Sonoff Zigbee USB Dongle Plus ZBDongle-P (TI CC2652P)
- Ubuntu server 22.04.3 LTS x86_64
- Docker version 24.0.5, API version 1.41 (downgraded from 1.43)
- Docker Compose 1.29.2-1
- Ethernet cable to my router, fixed IP
- Disabled built-in wifi and bluetooth
- HA container image version 2023.10.5,
- ZHA integration
- HACS integration 1.33.0
Compose file
version: '3.7'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:2023.10"
ports:
- 80:8123
volumes:
- /home/home/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
privileged: true
Service file (/etc/systemd/system/homeassistant.service
)
[Unit]
Description=HomeAssistant
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/home
ExecStart=/usr/bin/docker-compose -f /home/home/homeassistant.yaml up -d
ExecStop=/usr/bin/docker-compose -f /home/home/homeassistant.yaml down
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target