From 9b120392c2f7a4aa165a052b975fc6d6f1b3b332 Mon Sep 17 00:00:00 2001 From: wizzdom Date: Thu, 22 Feb 2024 22:46:28 +0000 Subject: [PATCH] atlas: new name, new domain, new redirects (#31) --- jobs/nginx/11ty-website.hcl | 46 -------------------------------- jobs/nginx/atlas.hcl | 53 +++++++++++++++++++++++++++++++++++++ jobs/traefik.hcl | 2 +- 3 files changed, 54 insertions(+), 47 deletions(-) delete mode 100644 jobs/nginx/11ty-website.hcl create mode 100644 jobs/nginx/atlas.hcl diff --git a/jobs/nginx/11ty-website.hcl b/jobs/nginx/11ty-website.hcl deleted file mode 100644 index bbc0a86..0000000 --- a/jobs/nginx/11ty-website.hcl +++ /dev/null @@ -1,46 +0,0 @@ -job "11ty-website" { - datacenters = ["aperture"] - type = "service" - - group "nginx-11ty-website" { - count = 1 - - network { - port "http" { - to = 80 - } - } - - service { - port = "http" - - check { - type = "http" - path = "/" - interval = "10s" - timeout = "2s" - } - - tags = [ - "traefik.enable=true", - "traefik.http.routers.nginx-11ty-website.rule=Host(`canary.redbrick.dcu.ie`)", - "traefik.http.routers.nginx-11ty-website.entrypoints=web,websecure", - "traefik.http.routers.nginx-11ty-website.tls.certresolver=lets-encrypt", - ] - } - - task "webserver" { - driver = "docker" - - config { - image = "ghcr.io/redbrick/11ty-website:latest" - ports = ["http"] - } - - resources { - cpu = 100 - memory = 500 - } - } - } -} diff --git a/jobs/nginx/atlas.hcl b/jobs/nginx/atlas.hcl new file mode 100644 index 0000000..0f1b5a7 --- /dev/null +++ b/jobs/nginx/atlas.hcl @@ -0,0 +1,53 @@ +job "atlas" { + datacenters = ["aperture"] + type = "service" + + meta { + git-sha = "" + } + + group "nginx-atlas" { + count = 1 + + network { + port "http" { + to = 80 + } + } + + service { + port = "http" + + check { + type = "http" + path = "/" + interval = "10s" + timeout = "2s" + } + + tags = [ + "traefik.enable=true", + "traefik.http.routers.nginx-atlas.rule=Host(`redbrick.dcu.ie`) || Host(`rb.dcu.ie`)", + "traefik.http.routers.nginx-atlas.entrypoints=web,websecure", + "traefik.http.routers.nginx-atlas.tls.certresolver=lets-encrypt", + "traefik.http.routers.nginx-atlas.middlewares=redirect-user-web", + "traefik.http.middlewares.redirect-user-web.redirectregex.regex=https://redbrick\\.dcu\\.ie/~([^/]*)/?([^/].*)?", + "traefik.http.middlewares.redirect-user-web.redirectregex.replacement=https://$1.redbrick.dcu.ie/$2", + ] + } + + task "web" { + driver = "docker" + + config { + image = "ghcr.io/redbrick/atlas:latest" + ports = ["http"] + } + + resources { + cpu = 100 + memory = 50 + } + } + } +} diff --git a/jobs/traefik.hcl b/jobs/traefik.hcl index 7074f9c..5a69962 100644 --- a/jobs/traefik.hcl +++ b/jobs/traefik.hcl @@ -27,7 +27,7 @@ job "traefik" { config { image = "traefik" network_mode = "host" - + volumes = [ "local/traefik.toml:/etc/traefik/traefik.toml", ]