Difference between revisions of "Home Automation/Hass with Dockerfile"

From srakrn | Wiki
Jump to navigation Jump to search
(Created page with "``` version: '3.2' volumes: zigbee2mqtt: mosquitto: hass: nodered: services: mosquitto: image: eclipse-mosquitto:2.0.18 restart: unless-stopped net...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
```
+
Just replace Node-RED image with the vanilla one if you are not installing extra NPM libs:
 +
 
 +
<pre>
 
version: '3.2'
 
version: '3.2'
  
Line 7: Line 9:
 
   hass:
 
   hass:
 
   nodered:
 
   nodered:
 +
  hass_media:
 
      
 
      
 
services:
 
services:
Line 16: Line 19:
 
       - mosquitto:/mosquitto/config
 
       - mosquitto:/mosquitto/config
 
   zigbee2mqtt:
 
   zigbee2mqtt:
     image: koenkk/zigbee2mqtt:1.40.1
+
     image: koenkk/zigbee2mqtt:2.2.1
 
     volumes:
 
     volumes:
 
       - zigbee2mqtt:/app/data
 
       - zigbee2mqtt:/app/data
Line 28: Line 31:
 
       - TZ
 
       - TZ
 
   hass:
 
   hass:
     image: homeassistant/home-assistant:2024.9
+
     image: homeassistant/home-assistant:2025.3.2
 
     restart: unless-stopped
 
     restart: unless-stopped
 
     network_mode: host
 
     network_mode: host
Line 35: Line 38:
 
       - /etc/localtime:/etc/localtime
 
       - /etc/localtime:/etc/localtime
 
       - /run/dbus:/run/debus:ro
 
       - /run/dbus:/run/debus:ro
 +
      - hass_media:/media
 
   node-red:
 
   node-red:
     image: srakrn/node-red-with-modules:20240215-it2
+
     image: srakrn/node-red-with-modules:20250420-it1
 
     restart: unless-stopped
 
     restart: unless-stopped
 
     network_mode: host
 
     network_mode: host
 
     volumes:
 
     volumes:
 
       - nodered:/data
 
       - nodered:/data
```
+
</pre>
 +
 
 +
Then expose with Cloudflare Zero Trust:
 +
 
 +
<pre>
 +
version: '3'
 +
services:
 +
  cftunnel:
 +
    image: cloudflare/cloudflared
 +
    restart: unless-stopped
 +
    command: tunnel run
 +
    environment:
 +
      - TUNNEL_TOKEN=${TUNNEL_TOKEN}
 +
    network_mode: "host"
 +
</pre>

Latest revision as of 13:19, 25 April 2025

Just replace Node-RED image with the vanilla one if you are not installing extra NPM libs:

version: '3.2'

volumes:
  zigbee2mqtt:
  mosquitto:
  hass:
  nodered:
  hass_media:
    
services:
  mosquitto:
    image: eclipse-mosquitto:2.0.18
    restart: unless-stopped
    network_mode: host
    volumes:
      - mosquitto:/mosquitto/config
  zigbee2mqtt:
    image: koenkk/zigbee2mqtt:2.2.1
    volumes:
      - zigbee2mqtt:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/serial/by-id/usb-1a86_USB_Single_Serial_5322028960-if00:/dev/ttyACM0
    restart: unless-stopped
    network_mode: host
    privileged: true
    environment:
      - TZ
  hass:
    image: homeassistant/home-assistant:2025.3.2
    restart: unless-stopped
    network_mode: host
    volumes:
      - hass:/config
      - /etc/localtime:/etc/localtime
      - /run/dbus:/run/debus:ro
      - hass_media:/media
  node-red:
    image: srakrn/node-red-with-modules:20250420-it1
    restart: unless-stopped
    network_mode: host
    volumes:
      - nodered:/data

Then expose with Cloudflare Zero Trust:

version: '3'
services:
  cftunnel:
    image: cloudflare/cloudflared
    restart: unless-stopped
    command: tunnel run
    environment:
      - TUNNEL_TOKEN=${TUNNEL_TOKEN}
    network_mode: "host"