nebula/kaarana/traefik.tf

64 lines
1.1 KiB
HCL

// Create a small database network
resource "docker_network" "traefik" {
name = "traefik"
labels = {
internal = "true"
role = "ingress"
}
internal = true
}
resource "docker_container" "traefik" {
name = "traefik"
image = "${docker_image.traefik.latest}"
upload {
content = "${file("${path.module}/traefik.toml")}"
file = "/etc/traefik/traefik.toml"
}
upload {
content = "${file("${path.module}/dyn.toml")}"
file = "/etc/traefik/dyn.toml"
}
volumes {
host_path = "/var/run/docker.sock"
container_path = "/var/run/docker.sock"
read_only = true
}
volumes {
host_path = "/mnt/disk/traefik"
container_path = "/acme"
}
ports {
internal = 443
external = 443
ip = "139.59.22.234"
}
ports {
internal = 80
external = 80
ip = "139.59.22.234"
}
memory = 256
restart = "always"
destroy_grace_seconds = 10
must_run = true
networks_advanced = [
{
name = "bridge"
},
{
name = "traefik"
},
]
}