E1iTeDa357 / docker-homeseer4

MIT License
8 stars 10 forks source link

Homeseer store doesn't work when run on a macvlan #2

Open lenaxia opened 3 years ago

lenaxia commented 3 years ago

I'm running HS4 in docker, and when its on a macvlan network, the shop is broken (see attachment). When I run it on a normal bridge network, the shop works fine. I need it on the macvlan because if its on a bridge network, it can't see Sonos devices on my network.

When I put my container on the macvlan (pubnet), going to /shop.html shows up completely empty. When I put the container on a normal bridge network, the shop works fine.

image_93628

version: "3"
services:
  homeseer:
    container_name: homeseer
    image: e1ite/docker-homeseer4:latest
    restart: unless-stopped
    ports:
      - 9898:80
      - 10200:10200
      - 10300:10300
      - 10401:10401
      - 11000:11000
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0 # Zwave
      - /dev/ttyUSB1:/dev/ttyUSB1 # Zigbee
    volumes:
      - "/mnt/docker/homeseer:/HomeSeer"
      - "/etc/localtime:/etc/localtime:ro"
    networks:
      - pubnet

networks:
  pubnet:
    external: true

Macvlan definition:

docker network create -d macvlan --subnet=192.168.0.0/23 --gateway=192.168.0.1 --ip-range=192.168.1.0/24 -o parent=enp1s0 -o mode=bridge --aux-address 'host=192.168.0.248' pubnet
ip link add pubnet-shim link enp1s0 type macvlan mode bridge
sudo ip link add pubnet-shim link enp1s0 type macvlan mode bridge
sudo ip addr add 192.168.0.248/32 dev pubnet-shim
sudo ip link set pubnet-shim up
ip route add 192.168.1.0/24 dev pubnet-shim
sudo ip route add 192.168.1.0/24 dev pubnet-shim
ip route
danielbrunt57 commented 3 years ago

I needed --net=host for MyHS remote app to work...

docker run -d \
--name homeseer \
-v /opt/HomeSeer:/HomeSeer \
-v /etc/localtime:/etc/localtime:ro \
--net=host \
--device /dev/ttyUSB0 \
e1ite/docker-homeseer4:latest
lenaxia commented 3 years ago

I'll give that a shot when I have a moment.