nomad

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

pleroma.nomad (1776B)


      1 # https://git.pleroma.social/pleroma/pleroma-docker-compose
      2 
      3 job "pleroma" {
      4   datacenters = ["dc1"]
      5 
      6   vault {}
      7 
      8   group "server" {
      9     count = 1
     10 
     11     volume "tls" {
     12       type = "csi"
     13       source = "certbot"
     14       access_mode = "multi-node-multi-writer"
     15       attachment_mode = "file-system"
     16     }
     17     volume "pleroma" {
     18       type = "csi"
     19       source = "pleroma"
     20       access_mode = "multi-node-multi-writer"
     21       attachment_mode = "file-system"
     22     }
     23 
     24     network {
     25       port "http" {
     26         to = 4000
     27       }
     28       port "https" {
     29         static = 44393
     30       }
     31     }
     32 
     33     task "nginx" {
     34       driver = "podman"
     35 
     36       config {
     37         image = "docker.io/library/nginx:stable-alpine"
     38         ports = ["https"]
     39         volumes = [
     40           # mount the templated config from the task directory to the container
     41           "local/pleroma.conf:/etc/nginx/conf.d/pleroma.conf",
     42         ]
     43       }
     44 
     45       volume_mount {
     46         volume = "tls"
     47         destination = "/etc/letsencrypt"
     48       }
     49 
     50       template {
     51         destination = "${NOMAD_TASK_DIR}/pleroma.conf"
     52         data = file("./templates/nginx.conf.tmpl")
     53       }
     54 
     55       resources {
     56         memory = 50
     57         memory_max = 256
     58         cpu    = 200
     59       }
     60     }
     61 
     62     task "pleroma" {
     63       driver = "podman"
     64 
     65       config {
     66         image = "git.pleroma.social:5050/pleroma/pleroma:latest"
     67         force_pull = true
     68         ports = ["http"]
     69       }
     70 
     71       volume_mount {
     72         volume = "pleroma"
     73         destination = "/var/lib/pleroma/uploads"
     74       }
     75 
     76       template {
     77         destination = "${NOMAD_TASK_DIR}/pleroma.env"
     78         data = file("./templates/pleroma.env.tmpl")
     79         env = true
     80       }
     81 
     82       resources {
     83         memory = 512
     84         memory_max = 1024
     85         cpu    = 500
     86       }
     87     }
     88 
     89   }
     90 }