From 2c2ee6c903a2068da202e9456f6fa7c37833e5d5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 8 Dec 2021 12:21:50 +0100 Subject: [PATCH] Rename tricot+traefik to frontend --- app/{traefik => frontend}/config/traefik.toml | 0 .../deploy/frontend-traefik.hcl} | 0 .../deploy/frontend-tricot.hcl} | 37 ++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) rename app/{traefik => frontend}/config/traefik.toml (100%) rename app/{traefik/deploy/traefik.hcl => frontend/deploy/frontend-traefik.hcl} (100%) rename app/{tricot/deploy/tricot.hcl => frontend/deploy/frontend-tricot.hcl} (51%) diff --git a/app/traefik/config/traefik.toml b/app/frontend/config/traefik.toml similarity index 100% rename from app/traefik/config/traefik.toml rename to app/frontend/config/traefik.toml diff --git a/app/traefik/deploy/traefik.hcl b/app/frontend/deploy/frontend-traefik.hcl similarity index 100% rename from app/traefik/deploy/traefik.hcl rename to app/frontend/deploy/frontend-traefik.hcl diff --git a/app/tricot/deploy/tricot.hcl b/app/frontend/deploy/frontend-tricot.hcl similarity index 51% rename from app/tricot/deploy/tricot.hcl rename to app/frontend/deploy/frontend-tricot.hcl index ad838a8..01b7097 100644 --- a/app/tricot/deploy/tricot.hcl +++ b/app/frontend/deploy/frontend-tricot.hcl @@ -1,26 +1,33 @@ -job "tricot" { +job "frontend" { datacenters = ["dc1", "neptune"] type = "system" priority = 90 - constraint { - attribute = "${attr.cpu.arch}" - value = "amd64" - } - update { - max_parallel = 1 + max_parallel = 1 stagger = "1m" } group "tricot" { - task "tricot" { + network { + port "http_port" { static = 80 } + port "https_port" { static = 443 } + port "admin_port" { static = 8082 } + } + + task "server" { driver = "docker" config { image = "lxpz/amd64_tricot:4" network_mode = "host" readonly_rootfs = true + ports = [ "http_port", "https_port", "admin_port" ] + } + + resources { + cpu = 1000 + memory = 100 } restart { @@ -40,8 +47,18 @@ EOH env = true } - resources { - memory = 40 + service { + name = "tricot-http" + port = "http_port" + tags = [ "(diplonat (tcp_port 80))" ] + address_mode = "host" + } + + service { + name = "tricot-https" + port = "https_port" + tags = [ "(diplonat (tcp_port 443))" ] + address_mode = "host" } } }