Skip to content

Commit

Permalink
Debugging Traefik rules
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbaggett committed Dec 5, 2024
1 parent f1593c4 commit 6ce5197
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/service/labels.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ locals {
} : {
"traefik.enable" = "true"
"traefik.http.routers.${local.service_name}.rule" = "Host(`${var.traefik.domain}`)"
"traefik.http.routers.${local.service_name}.entrypoints" = var.traefik.ssl ? "websecure" : "web"
"traefik.http.routers.${local.service_name}.entrypoints" = var.traefik.ssl ? "web,websecure" : "web"
"traefik.http.routers.${local.service_name}.tls.certresolver" = var.traefik.ssl ? "default" : ""
}),
(try(var.traefik.port, null) == null ? {} : {
Expand Down
3 changes: 2 additions & 1 deletion docker/service/service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ resource "docker_service" "instance" {

# Apply the list of Container Labels
dynamic "labels" {
for_each = local.labels
# Filter out null values
for_each = [for label in var.labels : label if label != null]
content {
label = labels.key
value = labels.value
Expand Down

0 comments on commit 6ce5197

Please sign in to comment.