aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/cryptpad/deploy/cryptpad.hcl
blob: 59803bf292e7fcff3f6e9c2d5670a29a0f5bf12b (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
75
76
job "cryptpad" {
  datacenters = ["neptune"]
  type = "service"
  
  group "cryptpad" {
    count = 1

    network {
      port "http" {
        to = 3000
      }
    }

    restart {
      attempts = 10
      delay    = "30s"
    }

    task "main" {
      driver = "docker"

      constraint {
        attribute = "${attr.unique.hostname}"
        operator = "="
        value = "courgette"
      }

      config {
        image = "superboum/cryptpad:0p3s44hjh4s1x55kbwkmywmwmx4wfyb8"
        ports = [ "http" ]

        volumes = [
          "/mnt/storage/cryptpad:/mnt",
          "secrets/config.js:/etc/cryptpad/config.js",
        ]
      }
      env {
        CRYPTPAD_CONFIG = "/etc/cryptpad/config.js"
      }

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

      /* Disabled because it requires modifications to the docker image and I do not want to invest the time yet
      template {
        data = file("../config/application_config.js")
        destination = "secrets/config.js"
      }
      */

      resources {
        memory = 1000
        cpu = 500
      }

      service {
        name = "cryptpad"
        port = "http"
        tags = [
          "tricot pad.deuxfleurs.fr",
          "tricot pad-sandbox.deuxfleurs.fr",
          "tricot-add-header Cross-Origin-Resource-Policy cross-origin",
          "tricot-add-header Cross-Origin-Embedder-Policy require-corp",
        ]
        check {
          type = "http"
          path = "/"
          interval = "10s"
          timeout = "2s"
        }
      }
    }
  }
}