nomad

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

ampache-catalog.nomad (1179B)


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