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

42 lines
1,010 B
Terraform
Raw Normal View History

2024-06-27 21:17:13 +00:00
resource "docker_image" "octoprint" {
2024-06-28 10:43:20 +00:00
provider = docker.printi
name = "octoprint"
2024-06-27 21:17:13 +00:00
build {
context = "${path.module}/printers"
2024-06-28 10:43:20 +00:00
target = "octoprint-mjpg-streamer"
2024-06-28 13:49:44 +00:00
tag = ["ti-octoprint:latest"]
2024-06-27 21:17:13 +00:00
}
}
2024-06-28 10:43:20 +00:00
resource "docker_volume" "ender5plus" {
provider = docker.printi
2024-06-28 13:49:44 +00:00
name = "ender5plus_config"
2024-06-28 10:43:20 +00:00
}
2024-07-03 16:27:25 +00:00
resource "scratch_string" "arse" {
in = yamlencode(docker_image.octoprint)
}
2024-06-28 10:43:20 +00:00
resource "docker_container" "ender5plus" {
2024-07-03 23:09:08 +00:00
image = docker_image.octoprint.image_id
2024-06-28 10:43:20 +00:00
provider = docker.printi
2024-06-29 18:38:30 +00:00
name = "ender5plus"
env = [
"ENABLE_MJPG_STREAMER=false"
]
2024-06-29 18:38:30 +00:00
network_mode = "bridge"
restart = "always"
ports {
internal = 80
external = 3000
2024-06-28 10:43:20 +00:00
}
devices {
2024-06-29 18:38:30 +00:00
host_path = "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A602AFFK-if00-port0"
container_path = "/dev/ttyACM0"
2024-06-29 18:38:30 +00:00
permissions = "rwm"
}
volumes {
container_path = "/octoprint"
#host_path = docker_volume.ender5plus.name
volume_name = docker_volume.ender5plus.name
2024-06-28 10:43:20 +00:00
}
}