From 9722a4b9e02740073797967017dc058a14e760f0 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Fri, 28 Jun 2024 19:44:06 +0200 Subject: [PATCH] Swap docker_service for ender5plus with a docker_container so we can use devices, d'oh. --- printers.tf | 48 ++++++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/printers.tf b/printers.tf index bb3d5c2..7a0fdce 100644 --- a/printers.tf +++ b/printers.tf @@ -13,37 +13,25 @@ resource "docker_volume" "ender5plus" { name = "ender5plus_config" } -resource "docker_service" "ender5plus" { +resource "docker_container" "ender5plus" { + image = "${docker_image.octoprint.name}:latest" provider = docker.printi - name = "ender5plus" - task_spec { - container_spec { - image = "${docker_image.octoprint.name}:latest" - mounts { - target = "/octoprint" - source = docker_volume.ender5plus.name - type = "volume" - } - mounts { - target = "/dev/ttyACM0" - source = "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A602AFFK-if00-port0" - type = "bind" - } - env = { - #ENABLE_MJPG_STREAMER = "true" - } - } - restart_policy { - condition = "any" - delay = "20s" - window = "0s" - } + name = "ender5plus" + env = [ + "ENABLE_MJPG_STREAMER=false" + ] + restart = "always" + ports { + internal = 80 + external = 3000 } - endpoint_spec { - ports { - target_port = 80 - published_port = 3000 - publish_mode = "ingress" - } + devices { + host_path = "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A602AFFK-if00-port0" + container_path = "/dev/ttyACM0" + } + volumes { + container_path = "/octoprint" + #host_path = docker_volume.ender5plus.name + volume_name = docker_volume.ender5plus.name } } \ No newline at end of file