From 47ac056f6a0065bf006c1c790dab7bc4431f0fce Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 7 May 2022 10:38:13 +0200 Subject: [PATCH] add vaultwarden --- vaultwarden.nomad | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 vaultwarden.nomad diff --git a/vaultwarden.nomad b/vaultwarden.nomad new file mode 100644 index 0000000..387aa9b --- /dev/null +++ b/vaultwarden.nomad @@ -0,0 +1,70 @@ + +job "vaultwarden" { + datacenters = ["homelab"] + type = "service" + meta { + forcedeploy = "0" + } + + group "vaultwarden"{ + network { + mode = "host" + port "http" { + to = 80 + } + } + vault{ + policies= ["access-tables"] + + } + task "server" { + driver = "docker" + service { + name = "vaultwarden" + port = "http" + tags = [ + "traefik.enable=true", + "traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`vault.ducamps.win`)", + "traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=vault.ducamps.win", + "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", + ] + check { + type = "http" + path = "/" + interval = "60s" + timeout = "20s" + + check_restart { + limit = 3 + grace = "240s" + } + } + } + config { + image = "vaultwarden/server" + ports = ["http"] + volumes = [ + "/mnt/diskstation/nomad/vaultwarden:/data" + ] + + } + env { + DATA_FOLDER = "/data" + WEB_VAULT_ENABLED = "true" + DOMAIN = "https://vault.ducamps.win" + + } + + template { + data= <