nomad

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

ampache.nomad (1901B)


      1 job "ampache" {
      2   datacenters = ["dc1"]
      3 
      4   vault {}
      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     volume "ampache" {
     16       type = "csi"
     17       source = "ampache"
     18       access_mode = "multi-node-multi-writer"
     19       attachment_mode = "file-system"
     20     }
     21 
     22     network {
     23       port "ampache" {
     24         to = 80
     25       }
     26       port "https" {
     27         to = 443
     28         static = 44391
     29       }
     30     }
     31 
     32     task "nginx" {
     33       driver = "podman"
     34 
     35       config {
     36         image = "docker.io/library/nginx:stable-alpine"
     37         ports = ["https"]
     38         volumes = [
     39           # mount the templated config from the task directory to the container
     40           "local/ampache.conf:/etc/nginx/conf.d/ampache.conf",
     41         ]
     42       }
     43 
     44       volume_mount {
     45         volume = "tls"
     46         destination = "/etc/letsencrypt"
     47       }
     48 
     49       template {
     50         destination = "${NOMAD_TASK_DIR}/ampache.conf"
     51         data = file("./templates/nginx.conf.tmpl")
     52       }
     53 
     54       resources {
     55         memory = 50
     56         memory_max = 256
     57         cpu    = 200
     58       }
     59     }
     60 
     61     task "ampache" {
     62       driver = "podman"
     63 
     64       config {
     65         image = "docker.io/ampache/ampache:nosql"
     66         force_pull = true
     67         ports = ["ampache"]
     68         volumes = [
     69           # mount the templated config from the task directory to the container
     70           "local/ampache.cfg.php:/var/www/config/ampache.cfg.php",
     71         ]
     72       }
     73 
     74       volume_mount {
     75         volume = "ampache"
     76         destination = "/media"
     77       }
     78 
     79       template {
     80         destination = "${NOMAD_TASK_DIR}/ampache.cfg.php"
     81         data = file("./templates/ampache.cfg.php.tmpl")
     82         uid = 33
     83         gid = 33
     84       }
     85 
     86       resources {
     87         memory = 50
     88         memory_max = 512
     89         cpu    = 300
     90       }
     91     }
     92 
     93   }
     94 }