aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/cms/deploy/cms.hcl
blob: 1f9f0727caf7d168cfc25e4cb1b59eb0aa95c277 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
job "cms" {
  datacenters = ["neptune", "orion"]
  type = "service"

  priority = 100

  constraint {
    attribute = "${attr.cpu.arch}"
    value     = "amd64"
  }

  group "auth" {
    count = 1

    network {
      port "web_port" { }
    }

    task "teabag" {
      driver = "docker"
      config {
        # Using a digest to pin the container as no tag is provided
        # https://github.com/denyskon/teabag/pkgs/container/teabag
        image = "ghcr.io/denyskon/teabag@sha256:d5af7c6caf172727fbfa047c8ee82f9087ef904f0f3bffdeec656be04e9e0a14"
        ports = [ "web_port" ]
        volumes = [
          "secrets/teabag.env:/etc/teabag/teabag.env",
        ]
      }

      template {
        data = file("../config/teabag.env")
        destination = "secrets/teabag.env"
      }

      resources {
        memory = 20
        memory_max = 50
        cpu = 50
      }

      service {
        name = "teabag"
        tags = [
          "teabag",
          "tricot teabag.deuxfleurs.fr",
          "d53-cname teabag.deuxfleurs.fr",
        ]
        port = "web_port"
        check {
          type = "http"
          protocol = "http"
          port = "web_port"
          path = "/"
          interval = "60s"
          timeout = "5s"
          check_restart {
            limit = 3
            grace = "600s"
            ignore_warnings = false
          }
        }
      }

      restart {
        interval = "30m"
        attempts = 20
        delay    = "15s"
        mode     = "delay"
      }
    }
  }
}