aboutsummaryrefslogblamecommitdiff
path: root/app/cryptpad/deploy/cryptpad.hcl
blob: b04b330b17e739a97120a408e4eb175152deb431 (plain) (tree)























                           
                                                                     
























                                                      

                                                                        












                                             

                                                                        










                          
job "cryptpad" {
  datacenters = ["neptune"]
  type = "service"
  
  group "cryptpad" {
    count = 1

    network {
      port "unsafe" {
        to = 3000
      }
      port "sandbox" {
        to = 3001
      }
    }

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

    task "main" {
      driver = "docker"
      config {
        image = "superboum/cryptpad:7l2fgdl9bfvf8s87rparamm9cvhb5ind"
        ports = [ "unsafe", "sandbox" ]

        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"
      }

      resources {
        memory = 1000
        cpu = 500
      }

      service {
        port = "unsafe"
        tags = [
          "tricot pad.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"
        }
      }

      service {
        port = "sandbox"
        tags = [
          "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"
        }
      }
    }
  }
}