Add health checks
All checks were successful
Build and Push Docker Image / build (push) Successful in 39s
All checks were successful
Build and Push Docker Image / build (push) Successful in 39s
This commit is contained in:
@@ -33,6 +33,7 @@ job "blog" {
|
|||||||
"traefik.http.routers.blog.rule=Host(`${local.HOST}`)",
|
"traefik.http.routers.blog.rule=Host(`${local.HOST}`)",
|
||||||
"traefik.http.routers.blog.entrypoints=websecure",
|
"traefik.http.routers.blog.entrypoints=websecure",
|
||||||
"traefik.http.routers.blog.tls=true",
|
"traefik.http.routers.blog.tls=true",
|
||||||
|
"traefik.http.routers.blog.service=blog-svc",
|
||||||
|
|
||||||
# ----- router for the www domain (new) -----
|
# ----- router for the www domain (new) -----
|
||||||
"traefik.http.routers.blog-www.rule=Host(`www.${local.HOST}`)",
|
"traefik.http.routers.blog-www.rule=Host(`www.${local.HOST}`)",
|
||||||
@@ -43,7 +44,13 @@ job "blog" {
|
|||||||
# ----- middleware that does the 301 redirect -----
|
# ----- middleware that does the 301 redirect -----
|
||||||
"traefik.http.middlewares.redirect-www-to-root.redirectregex.regex=^https?://www\\.${local.HOST}(.*)",
|
"traefik.http.middlewares.redirect-www-to-root.redirectregex.regex=^https?://www\\.${local.HOST}(.*)",
|
||||||
"traefik.http.middlewares.redirect-www-to-root.redirectregex.replacement=https://${local.HOST}$${1}",
|
"traefik.http.middlewares.redirect-www-to-root.redirectregex.replacement=https://${local.HOST}$${1}",
|
||||||
"traefik.http.middlewares.redirect-www-to-root.redirectregex.permanent=true"
|
"traefik.http.middlewares.redirect-www-to-root.redirectregex.permanent=true",
|
||||||
|
|
||||||
|
# ----- service and health check -----
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.path=/healthz",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.interval=5s",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.timeout=2s",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.hostname=${local.HOST}",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,13 +105,18 @@
|
|||||||
"traefik.http.routers.blog.rule=Host(`cbraaten.dev`)",
|
"traefik.http.routers.blog.rule=Host(`cbraaten.dev`)",
|
||||||
"traefik.http.routers.blog.entrypoints=websecure",
|
"traefik.http.routers.blog.entrypoints=websecure",
|
||||||
"traefik.http.routers.blog.tls=true",
|
"traefik.http.routers.blog.tls=true",
|
||||||
|
"traefik.http.routers.blog.service=blog-svc",
|
||||||
"traefik.http.routers.blog-www.rule=Host(`www.cbraaten.dev`)",
|
"traefik.http.routers.blog-www.rule=Host(`www.cbraaten.dev`)",
|
||||||
"traefik.http.routers.blog-www.entrypoints=websecure",
|
"traefik.http.routers.blog-www.entrypoints=websecure",
|
||||||
"traefik.http.routers.blog-www.tls=true",
|
"traefik.http.routers.blog-www.tls=true",
|
||||||
"traefik.http.routers.blog-www.middlewares=redirect-www-to-root",
|
"traefik.http.routers.blog-www.middlewares=redirect-www-to-root",
|
||||||
"traefik.http.middlewares.redirect-www-to-root.redirectregex.regex=^https?://www\\.cbraaten.dev(.*)",
|
"traefik.http.middlewares.redirect-www-to-root.redirectregex.regex=^https?://www\\.cbraaten.dev(.*)",
|
||||||
"traefik.http.middlewares.redirect-www-to-root.redirectregex.replacement=https://cbraaten.dev${1}",
|
"traefik.http.middlewares.redirect-www-to-root.redirectregex.replacement=https://cbraaten.dev${1}",
|
||||||
"traefik.http.middlewares.redirect-www-to-root.redirectregex.permanent=true"
|
"traefik.http.middlewares.redirect-www-to-root.redirectregex.permanent=true",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.path=/healthz",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.interval=5s",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.timeout=2s",
|
||||||
|
"traefik.http.services.blog-svc.loadbalancer.healthcheck.hostname=cbraaten.dev"
|
||||||
],
|
],
|
||||||
"CanaryTags": null,
|
"CanaryTags": null,
|
||||||
"EnableTagOverride": false,
|
"EnableTagOverride": false,
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ Bun.serve({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
"/healthz": new Response('ok'),
|
||||||
"/*": (req) => {
|
"/*": (req) => {
|
||||||
if(req.headers.get("shell-loaded") === "true") {
|
if(req.headers.get("shell-loaded") === "true") {
|
||||||
return compressResponse(renderToString(<NotFound />), 404);
|
return compressResponse(renderToString(<NotFound />), 404);
|
||||||
|
|||||||
Reference in New Issue
Block a user