nomad

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

diary.nomad (1283B)


      1 job "diary" {
      2   datacenters = ["dc1"]
      3 
      4   priority = 80
      5 
      6   group "server" {
      7     count = 1
      8 
      9     volume "tls" {
     10       type = "csi"
     11       source = "certbot"
     12       access_mode = "multi-node-multi-writer"
     13       attachment_mode = "file-system"
     14     }
     15 
     16     network {
     17       port "jekyll" {
     18         to = 4000
     19       }
     20       port "https" {
     21         static = 44362
     22       }
     23     }
     24 
     25     task "jekyll" {
     26       driver = "podman"
     27 
     28       config {
     29         image = "127.0.0.1:5000/jekyll-diary:latest"
     30         force_pull = true
     31         ports = ["jekyll"]
     32       }
     33 
     34       resources {
     35         memory = 50
     36         memory_max = 128
     37         cpu = 200
     38       }
     39     }
     40 
     41     task "nginx" {
     42       driver = "podman"
     43 
     44       config {
     45         image = "docker.io/library/nginx:stable-alpine"
     46         ports = ["https"]
     47         volumes = [
     48           # mount the templated config from the task directory to the container
     49           "local/diary.conf:/etc/nginx/conf.d/diary.conf",
     50         ]
     51       }
     52 
     53       volume_mount {
     54         volume = "tls"
     55         destination = "/etc/letsencrypt"
     56       }
     57 
     58       template {
     59         destination = "${NOMAD_TASK_DIR}/diary.conf"
     60         data = file("./templates/nginx.conf.tmpl")
     61       }
     62 
     63       resources {
     64         memory = 50
     65         memory_max = 128
     66         cpu    = 200
     67       }
     68     }
     69   }
     70 }