aboutsummaryrefslogtreecommitdiff
path: root/cluster/staging/app/core/deploy/core-service.hcl
blob: 47d63de4be1a104bcd9600b740bc82e5768fb44a (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
job "core-service" {
  datacenters = ["neptune", "jupiter", "corrin", "bespin"]
  type = "service"
  priority = 90

  group "D53" {
    count = 1

    task "d53" {
      driver = "nix2"

      config {
        packages = [
          "git+https://git.deuxfleurs.fr/lx/D53.git?ref=main&rev=f7682170805b7953d23745b0414b0f7b6a133225"
        ]
        command = "d53"
      }

      resources {
        cpu = 100
        memory = 100
      }

      restart {
        interval = "3m"
        attempts = 10
        delay    = "15s"
        mode     = "delay"
      }

      template {
        data = "{{ key \"secrets/consul/consul-ca.crt\" }}"
        destination = "etc/tricot/consul-ca.crt"
      }

      template {
        data = "{{ key \"secrets/consul/consul-client.crt\" }}"
        destination = "etc/tricot/consul-client.crt"
      }

      template {
        data = "{{ key \"secrets/consul/consul-client.key\" }}"
        destination = "etc/tricot/consul-client.key"
      }

      template {
        data = <<EOH
D53_CONSUL_HOST=https://localhost:8501
D53_CONSUL_CA_CERT=/etc/tricot/consul-ca.crt
D53_CONSUL_CLIENT_CERT=/etc/tricot/consul-client.crt
D53_CONSUL_CLIENT_KEY=/etc/tricot/consul-client.key
D53_PROVIDERS=deuxfleurs.org:gandi
D53_GANDI_API_KEY={{ key "secrets/d53/gandi_api_key" }}
D53_ALLOWED_DOMAINS=staging.deuxfleurs.org
RUST_LOG=d53=info
EOH
        destination = "secrets/env"
        env = true
      }
    }
  }
}