nomad

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

cv.nomad (1251B)


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