diff options
Diffstat (limited to 'cluster/prod/app/plume/deploy/plume.hcl')
-rw-r--r-- | cluster/prod/app/plume/deploy/plume.hcl | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/cluster/prod/app/plume/deploy/plume.hcl b/cluster/prod/app/plume/deploy/plume.hcl index 26bc6db..c759a02 100644 --- a/cluster/prod/app/plume/deploy/plume.hcl +++ b/cluster/prod/app/plume/deploy/plume.hcl @@ -6,7 +6,45 @@ job "plume-blog" { count = 1 network { - port "web_port" { } + port "back_port" { } + port "cache_port" { } + } + + task "varnish" { + driver = "docker" + config { + image = "varnish:7.6.1" + network_mode = "host" + ports = [ "cache_port" ] + + # cache + mount { + type = "tmpfs" + target = "/var/lib/varnish/varnishd:exec" + readonly = false + tmpfs_options { + size = 2684354559 # 2.5GB in bytes + } + } + } + + env { + VARNISH_SIZE = "2G" + VARNISH_BACKEND_HOST = "localhost" + VARNISH_BACKEND_PORT = "${NOMAD_PORT_back_port}" + VARNISH_HTTP_PORT = "${NOMAD_PORT_cache_port}" + } + + service { + name = "plume-cache" + tags = [ + "plume", + "tricot plume.deuxfleurs.fr", + "d53-cname plume.deuxfleurs.fr", + ] + port = "cache_port" + address_mode = "host" + } } task "plume" { @@ -14,9 +52,9 @@ job "plume-blog" { config { image = "lxpz/plume_s3:v1" network_mode = "host" - ports = [ "web_port" ] + ports = [ "back_port" ] command = "sh" - args = [ "-c", "plm search init; plm search refill; plume" ] + args = [ "-c", "plm search init; plume" ] } template { @@ -26,24 +64,22 @@ job "plume-blog" { } resources { - memory = 200 - memory_max = 800 + memory = 512 + memory_max = 512 cpu = 100 } service { - name = "plume" + name = "plume-back" tags = [ "plume", - "tricot plume.deuxfleurs.fr", - "d53-cname plume.deuxfleurs.fr", ] - port = "web_port" + port = "back_port" address_mode = "host" check { type = "http" protocol = "http" - port = "web_port" + port = "back_port" path = "/" interval = "60s" timeout = "5s" @@ -55,7 +91,7 @@ job "plume-blog" { } } restart { - interval = "30m" + interval = "20m" attempts = 20 delay = "15s" mode = "delay" |