Skip to content

Commit c14a994

Browse files
committed
Reduce Traefik 502 during deploymnets
1 parent 51d2301 commit c14a994

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

infrastructure/applications/cluster/load_balancer_task.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ resource "aws_ecs_task_definition" "traefik" {
2424
{
2525
name = "TRAEFIK_ENTRYPOINTS_WEB_ADDRESS",
2626
value = ":80"
27+
},
28+
{
29+
name = "TRAEFIK_PROVIDERS_ECS_HEALTHYTASKSONLY",
30+
value = "true"
31+
},
32+
{
33+
name = "TRAEFIK_PROVIDERS_ECS_REFRESHSECONDS",
34+
value = "5"
2735
}
2836
]
2937

infrastructure/applications/pretix/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ resource "aws_ecs_task_definition" "pretix" {
2121
"traefik.http.routers.pretix-web.rule" = "Host(`${local.alias}`)"
2222
}
2323

24+
healthCheck = {
25+
retries = 3
26+
command = [
27+
"CMD-SHELL",
28+
"curl -f http://localhost:80/healthcheck/ || exit 1"
29+
]
30+
timeout = 3
31+
interval = 10
32+
}
33+
2434
environment = [
2535
{
2636
name = "PRETIX_SENTRY_DSN"

0 commit comments

Comments
 (0)