nomad

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

git.nomad (2461B)


      1 job "git" {
      2   datacenters = ["dc1"]
      3 
      4   priority = 80
      5 
      6   group "server" {
      7     count = 1
      8 
      9     volume "git" {
     10       type = "csi"
     11       source = "git"
     12       access_mode = "multi-node-multi-writer"
     13       attachment_mode = "file-system"
     14     }
     15     volume "stagit" {
     16       type = "csi"
     17       source = "stagit"
     18       access_mode = "multi-node-multi-writer"
     19       attachment_mode = "file-system"
     20     }
     21     volume "tls" {		
     22       type = "csi"		
     23       source = "certbot"		
     24       access_mode = "multi-node-multi-writer"		
     25       attachment_mode = "file-system"		
     26     }
     27 
     28     network {
     29       port "stagit" {
     30         to = 443
     31         static = 44328
     32       }
     33       port "smarthttp" {
     34         to = 443
     35         static = 44318
     36       }
     37     }
     38 
     39     task "smarthttp" {
     40       driver = "podman"
     41 
     42       config {
     43         image = "127.0.0.1:5000/git:latest"
     44         force_pull = true
     45         ports = ["smarthttp"]
     46         volumes = [
     47           # mount the templated config from the task directory to the container
     48           "local/smarthttp.conf:/etc/apache2/conf.d/smarthttp.conf",
     49         ]
     50       }
     51 
     52       template {
     53         destination = "${NOMAD_TASK_DIR}/smarthttp.conf"
     54         data = file("./templates/smarthttp.conf.tmpl")
     55       }
     56 
     57       volume_mount {
     58         volume = "git"
     59         destination = "/srv/git"
     60       }
     61       volume_mount {
     62         volume = "stagit"
     63         destination = "/var/www/localhost/htdocs"
     64       }
     65       volume_mount {		
     66         volume = "tls"		
     67         destination = "/etc/letsencrypt"		
     68       }
     69 
     70       resources {
     71         memory = 32
     72         memory_max = 64
     73         cpu    = 100
     74       }
     75     }
     76 
     77     task "stagit" {
     78       driver = "podman"
     79 
     80       config {
     81         image = "127.0.0.1:5000/git:latest"
     82         force_pull = true
     83         ports = ["stagit"]
     84         volumes = [
     85           # mount the templated config from the task directory to the container
     86           "local/stagit.conf:/etc/apache2/conf.d/stagit.conf",
     87         ]
     88       }
     89 
     90       template {
     91         destination = "${NOMAD_TASK_DIR}/stagit.conf"
     92         data = file("./templates/stagit.conf.tmpl")
     93       }
     94 
     95       volume_mount {
     96         volume = "git"
     97         destination = "/srv/git"
     98       }
     99       volume_mount {
    100         volume = "stagit"
    101         destination = "/var/www/localhost/htdocs"
    102       }
    103       volume_mount {		
    104         volume = "tls"		
    105         destination = "/etc/letsencrypt"		
    106       }
    107 
    108       resources {
    109         memory = 32
    110         memory_max = 64
    111         cpu    = 100
    112       }
    113     }
    114   }
    115 }