resource "docker_image" "loki" { name = "grafana/loki:3.2.1" } resource "docker_volume" "loki" { name = "loki" } resource "docker_container" "loki" { image = docker_image.loki.image_id name = "loki" privileged = false must_run = true network_mode = "bridge" networks_advanced { name = data.docker_network.traefik.name } networks_advanced { name = data.docker_network.dn42.name } dynamic "labels" { for_each = [ { label = "traefik.enable", value = "true" }, { label = "traefik.docker.network", value = data.docker_network.traefik.name }, { label = "traefik.http.routers.loki.rule", value = "Host(`loki.trygvis.io`)" }, { label = "traefik.http.routers.loki.entrypoints", value = "websecure" }, { label = "traefik.http.routers.loki.tls.certresolver", value = "linode" }, ] content { label = labels.value["label"] value = labels.value["value"] } } env = [ ] volumes { volume_name = docker_volume.loki.name container_path = "/loki" read_only = false } }