aboutsummaryrefslogtreecommitdiff
path: root/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2025-01-01 17:26:04 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2025-01-01 17:26:04 +0100
commitc42ae9d8b086ae3f2036ad743a324e682e5f4d08 (patch)
tree48123e6f040b55ec0ad6000dbd4d59a1726ba031 /terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf
parente768b1675922e746f09828920b05d836a1cd365b (diff)
downloadinfra-c42ae9d8b086ae3f2036ad743a324e682e5f4d08.tar.gz
infra-c42ae9d8b086ae3f2036ad743a324e682e5f4d08.tar.bz2
infra-c42ae9d8b086ae3f2036ad743a324e682e5f4d08.tar.xz
infra-c42ae9d8b086ae3f2036ad743a324e682e5f4d08.zip
zigbee2mqtt
Diffstat (limited to 'terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf')
-rw-r--r--terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf41
1 files changed, 41 insertions, 0 deletions
diff --git a/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf b/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf
new file mode 100644
index 0000000..a77fe95
--- /dev/null
+++ b/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf
@@ -0,0 +1,41 @@
+data "docker_registry_image" "zigbee2mqtt" {
+ name = local.docker_image
+}
+
+resource "docker_image" "zigbee2mqtt" {
+ name = data.docker_registry_image.zigbee2mqtt.name
+ pull_triggers = [data.docker_registry_image.zigbee2mqtt.sha256_digest]
+}
+
+resource "docker_volume" "zigbee2mqtt" {
+ name = "zigbee2mqtt"
+}
+
+resource "docker_container" "zigbee2mqtt" {
+ image = docker_image.zigbee2mqtt.image_id
+ name = "zigbee2mqtt"
+ hostname = "zigbee2mqtt"
+ # privileged = true
+ must_run = true
+
+ ports {
+ internal = 8080
+ external = 8080
+ protocol = "tcp"
+ }
+
+ volumes {
+ volume_name = docker_volume.zigbee2mqtt.name
+ read_only = false
+ container_path = "/app/data"
+ }
+
+ env = [
+ "TZ=Europe/Oslo",
+ ]
+
+ devices {
+ host_path = "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2688076-if00"
+ container_path = "/dev/ttyACM0"
+ }
+}