nomad

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

freshrss.nomad (2124B)


      1 job "freshrss" {
      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     volume "freshrss-data" {
     14       type = "csi"
     15       source = "freshrss-data"
     16       access_mode = "multi-node-multi-writer"
     17       attachment_mode = "file-system"
     18     }
     19     volume "freshrss-ext" {
     20       type = "csi"
     21       source = "freshrss-ext"
     22       access_mode = "multi-node-multi-writer"
     23       attachment_mode = "file-system"
     24     }
     25 
     26     network {
     27       port "server" {
     28         to = 80
     29       }
     30       port "https" {
     31         static = 44403
     32       }
     33     }
     34 
     35     task "nginx" {
     36       driver = "podman"
     37 
     38       config {
     39         image = "docker.io/library/nginx:stable-alpine"
     40         ports = ["https"]
     41         volumes = [
     42           # mount the templated config from the task directory to the container
     43           "local/freshrss.conf:/etc/nginx/conf.d/snibox.conf",
     44         ]
     45       }
     46 
     47       volume_mount {
     48         volume = "tls"
     49         destination = "/etc/letsencrypt"
     50       }
     51 
     52       template {
     53         destination = "${NOMAD_TASK_DIR}/freshrss.conf"
     54         data = file("./templates/nginx.conf.tmpl")
     55       }
     56 
     57       resources {
     58         memory = 50
     59         memory_max = 128
     60         cpu    = 100
     61       }
     62     }
     63 
     64     task "server" {
     65       driver = "podman"
     66 
     67       env {
     68 	# https://github.com/FreshRSS/FreshRSS/blob/edge/Docker/freshrss/example.env
     69         # https://github.com/FreshRSS/FreshRSS/blob/edge/Docker/README.md#environment-variables
     70 	BASE_URL = "https://rss.in0rdr.ch"
     71         TZ = "Europe/Zurich"
     72         CRON_MIN = "*/20"
     73       }
     74 
     75       config {
     76         image = "docker.io/freshrss/freshrss:latest"
     77         force_pull = true
     78         ports = ["server"]
     79       }
     80 
     81       volume_mount {
     82         volume = "freshrss-data"
     83         destination = "/var/www/FreshRSS/data"
     84       }
     85       volume_mount {
     86         volume = "freshrss-ext"
     87         destination = "/var/www/FreshRSS/extensions"
     88       }
     89 
     90       resources {
     91         memory = 150
     92         memory_max = 300
     93         cpu    = 300
     94       }
     95     }
     96   }
     97 }