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