aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-12-28 11:02:33 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-12-28 11:02:33 +0100
commitfc518df1c1a5d68fc8c05ed65b70a386a043b198 (patch)
tree1eb0e9f5c557f4109cd5ac1a1f22e656765ddf0a /app
parenta2f8e11d06f5232e1100fe278fc579c80f9970d0 (diff)
downloadinfrastructure-fc518df1c1a5d68fc8c05ed65b70a386a043b198.tar.gz
infrastructure-fc518df1c1a5d68fc8c05ed65b70a386a043b198.zip
Migrate Traefik
Diffstat (limited to 'app')
-rw-r--r--app/deployment/traefik.hcl43
1 files changed, 30 insertions, 13 deletions
diff --git a/app/deployment/traefik.hcl b/app/deployment/traefik.hcl
index 641187f..d0dc129 100644
--- a/app/deployment/traefik.hcl
+++ b/app/deployment/traefik.hcl
@@ -4,6 +4,13 @@ job "frontend" {
priority = 80
group "traefik" {
+
+ network {
+ port "http_port" { static = 80 }
+ port "https_port" { static = 443 }
+ port "admin_port" { static = 8082 }
+ }
+
task "server" {
driver = "docker"
@@ -14,21 +21,36 @@ job "frontend" {
volumes = [
"secrets/traefik.toml:/etc/traefik/traefik.toml",
]
+ ports = [ "http_port", "https_port", "admin_port" ]
}
resources {
memory = 265
}
+ template {
+ data = file("../config/configuration/traefik/traefik.toml")
+ destination = "secrets/traefik.toml"
+ }
+
service {
- tags = [
- "https",
- "frontend",
- "(diplonat (tcp_port 80 443))"
- ]
- port = 443
- address_mode = "driver"
- name = "traefik"
+ name = "traefik-http"
+ port = "http_port"
+ tags = [ "(diplonat (tcp_port 80))" ]
+ address_mode = "host"
+ }
+
+ service {
+ name = "traefik-https"
+ port = "https_port"
+ tags = [ "(diplonat (tcp_port 443))" ]
+ address_mode = "host"
+ }
+
+ service {
+ name = "traefik-admin"
+ port = "admin_port"
+ address_mode = "host"
check {
type = "http"
protocol = "http"
@@ -44,11 +66,6 @@ job "frontend" {
}
}
}
-
- template {
- data = "{{ key \"configuration/traefik/traefik.toml\" }}"
- destination = "secrets/traefik.toml"
- }
}
}
}