This repository has been archived on 2024-11-12. You can view files and clone it, but cannot push or open issues or pull requests.
iac/printers.tf
Matthew Baggett e725f54e85
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 1s
Fixed vigil
2024-06-28 17:53:53 +02:00

49 lines
No EOL
1.1 KiB
HCL

resource "docker_image" "octoprint" {
provider = docker.printi
name = "octoprint"
build {
context = "${path.module}/printers"
target = "octoprint-mjpg-streamer"
tag = ["ti-octoprint:latest"]
}
}
resource "docker_volume" "ender5plus" {
provider = docker.printi
name = "ender5plus_config"
}
resource "docker_service" "ender5plus" {
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"
}
}
endpoint_spec {
ports {
target_port = 80
published_port = 3000
publish_mode = "ingress"
}
}
}