From 18ecbb37c5bf0538346900af753f6fcd4abecbe6 Mon Sep 17 00:00:00 2001 From: lingkai5wu Date: Mon, 14 Sep 2026 22:10:28 +0800 Subject: [PATCH] feat: add Home Assistant service and host access network --- homeassistant/compose.yaml | 22 ++++++++++++++++++++++ nginx/compose.yaml | 16 +++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 homeassistant/compose.yaml diff --git a/homeassistant/compose.yaml b/homeassistant/compose.yaml new file mode 100644 index 0000000..411e829 --- /dev/null +++ b/homeassistant/compose.yaml @@ -0,0 +1,22 @@ +name: homeassistant +services: + homeassistant: + image: ghcr.io/home-assistant/home-assistant:2026.9.2 + container_name: homeassistant + volumes: + - /srv/data/home-assistant:/config + - /etc/localtime:/etc/localtime:ro + - /run/dbus:/run/dbus:ro + environment: + - TZ=Asia/Shanghai + network_mode: host + restart: unless-stopped + deploy: + resources: + limits: + cpus: "1.0" + memory: 2G + reservations: + cpus: "0.2" + memory: 512M + stop_grace_period: 60s diff --git a/nginx/compose.yaml b/nginx/compose.yaml index 783fc62..4096162 100644 --- a/nginx/compose.yaml +++ b/nginx/compose.yaml @@ -14,7 +14,11 @@ services: - "192.168.10.101:443:443" - "[::]:18443:443" networks: - - proxy + proxy: + host-access: + ipv4_address: 172.31.255.2 + extra_hosts: + - "host.internal:172.31.255.1" restart: unless-stopped deploy: resources: @@ -47,3 +51,13 @@ services: networks: proxy: external: true + host-access: + name: host-access + driver: bridge + driver_opts: + com.docker.network.bridge.name: br-host-access + internal: true + ipam: + config: + - subnet: 172.31.255.0/29 + gateway: 172.31.255.1