nomad

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

ampache-catalog.nomad (1203B)


      1 job "ampache-catalog" {
      2   datacenters = ["dc1"]
      3   type = "batch"
      4 
      5   vault {
      6     role = "ampache"
      7   }
      8 
      9   periodic {
     10     crons = [
     11       "@daily",
     12       #"*/12 * * * *"
     13     ]
     14   }
     15 
     16   group "catalog-update" {
     17     count = 1
     18 
     19     volume "ampache" {
     20       type = "csi"
     21       source = "ampache"
     22       access_mode = "multi-node-multi-writer"
     23       attachment_mode = "file-system"
     24     }
     25 
     26     task "update-catalog" {
     27       driver = "podman"
     28 
     29       config {
     30         image = "docker.io/ampache/ampache:nosql"
     31         command = "/bin/sh"
     32         # [-c|--cleanup] [-e|--verify] [-a|--add] [-g|--art]
     33         args = ["-c", "/var/www/bin/cli run:updateCatalog -ceag"]
     34         volumes = [
     35           # mount the templated config from the task directory to the container
     36           "local/ampache.cfg.php:/var/www/config/ampache.cfg.php",
     37         ]
     38       }
     39 
     40       volume_mount {
     41         volume = "ampache"
     42         destination = "/media"
     43       }
     44 
     45       template {
     46         destination = "${NOMAD_TASK_DIR}/ampache.cfg.php"
     47         data = file("./templates/ampache.cfg.php.tmpl")
     48         uid = 33
     49         gid = 33
     50       }
     51 
     52       resources {
     53         memory = 50
     54         memory_max = 256
     55         cpu    = 100
     56       }
     57     }
     58   }
     59 }