Swap docker_service for ender5plus with a docker_container so we can use devices, d'oh.
This commit is contained in:
parent
aed00f6017
commit
9722a4b9e0
1 changed files with 18 additions and 30 deletions
48
printers.tf
48
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
|
||||
}
|
||||
}
|
Reference in a new issue