nomad

HCL and Docker files for Nomad deployments
git clone https://git.in0rdr.ch/nomad.git
Log | Files | Refs | Pull requests |Archive

silverbullet.nomad (1804B)


      1 # https://silverbullet.md/Install/Docker
      2 job "silverbullet" {
      3   datacenters = ["dc1"]
      4 
      5   vault {}
      6 
      7   group "server" {
      8     count = 1
      9 
     10     volume "silverbullet" {
     11       type = "csi"
     12       source = "silverbullet"
     13       access_mode = "multi-node-multi-writer"
     14       attachment_mode = "file-system"
     15     }
     16     volume "tls" {
     17       type = "csi"
     18       source = "certbot"
     19       access_mode = "multi-node-multi-writer"
     20       attachment_mode = "file-system"
     21     }
     22 
     23     network {
     24       port "http" {
     25         to = 3000
     26       }
     27       port "https" {
     28         static = 44407
     29       }
     30     }
     31 
     32     task "silverbullet" {
     33       driver = "podman"
     34 
     35       config {
     36         image = "docker.io/zefhemel/silverbullet:latest"
     37         ports = ["http"]
     38       }
     39 
     40       template {
     41         destination = "${NOMAD_SECRETS_DIR}/silverbullet.env"
     42         env = true
     43         data = <<EOT
     44 SB_USER = "{{with secret "kv/silverbullet"}}{{index .Data.data.sb_user}}{{end}}"
     45 EOT
     46       }
     47 
     48       volume_mount {
     49         volume = "silverbullet"
     50         destination = "/space"
     51       }
     52 
     53       resources {
     54         memory = 256
     55         memory_max = 512
     56         cpu    = 250
     57       }
     58     }
     59 
     60     task "nginx" {
     61       driver = "podman"
     62 
     63       config {
     64         image = "docker.io/library/nginx:stable-alpine"
     65         ports = ["https"]
     66         volumes = [
     67           # mount the templated config from the task directory to the container
     68           "local/silverbullet.conf:/etc/nginx/conf.d/silverbullet.conf",
     69         ]
     70       }
     71 
     72       volume_mount {
     73         volume = "tls"
     74         destination = "/etc/letsencrypt"
     75       }
     76 
     77       template {
     78         destination = "${NOMAD_TASK_DIR}/silverbullet.conf"
     79         data = file("./templates/nginx.conf.tmpl")
     80       }
     81 
     82       resources {
     83         memory = 50
     84         memory_max = 128
     85         cpu    = 200
     86       }
     87     }
     88   }
     89 }