Network Mode Selection | Nginx HTTPS vs Integrations

Alright so after an agonizing amount of looking into things I discovered this amazing solution! Essentially running a secondary container inside your docker network that connects to the host network and leaving Home Assistant on the host. This allows me to connect to the host with Home Assistant and enjoy all of the benefits of being on the same network as the devices I am targeting for integrations while still establishing HTTPS security outside my local network! If anyone is struggling with this please let minnow and I’ll do my best to assist you with your setup.

This is the example I captured from GitHub thanks to the great user there who posted it. I’ve implemented some tweaks into the code for my personal use but this really did just work like a charm. I’ve decided not to delete this post even after resolving my own issues since I’ve not seen anything posted here on the community for this kind of issue; something I believe would be quite a common problem.

  socat:
    image: alpine/socat:latest
    container_name: socat
    entrypoint: "socat tcp-listen:8122,fork,reuseaddr tcp-connect:192.168.1.110:8123"
    depends_on:
      - nginx-proxy
    environment:
      - LETSENCRYPT_HOST=home.example.com
      - [email protected]
      - VIRTUAL_PORT=8122
      - VIRTUAL_HOST=home.example.com
    ports:
      - 8122:8122
    restart: unless-stopped

1 Like