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

37 lines
870 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
}
resource "docker_container" "ender5plus" {
image = "${docker_image.octoprint.name}:latest"
2024-06-28 10:43:20 +00:00
provider = docker.printi
name = "ender5plus"
env = [
"ENABLE_MJPG_STREAMER=false"
]
restart = "always"
ports {
internal = 80
external = 3000
2024-06-28 10:43:20 +00:00
}
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
2024-06-28 10:43:20 +00:00
}
}