job "nextcloud" { datacenters = ["homelab"] type = "service" constraint { attribute = "${attr.cpu.arch}" value = "amd64" } meta { forcedeploy = "2" } group "nextcloud"{ network { mode = "host" port "http" { to = 80 } } vault{ policies= ["access-tables"] } task "server" { driver = "docker" service { name = "nextcloud" port = "http" tags = [ "traefik.enable=true", "traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`file.ducamps.win`)", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=file.ducamps.win", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", "traefik.http.routers.${NOMAD_JOB_NAME}_insecure.entrypoints=web", "traefik.http.routers.${NOMAD_JOB_NAME}_insecure.rule=Host(`file.ducamps.win`)", "traefik.http.routers.${NOMAD_JOB_NAME}_insecure.middlewares=httpsRedirect", "traefik.http.middlewares.httpsRedirect.redirectscheme.scheme=https", ] } config { image = "nextcloud:latest" ports = ["http"] volumes = [ "/mnt/diskstation/nextcloud/data:/var/www/html/data", "/mnt/diskstation/nextcloud/config:/var/www/html/config", "/mnt/diskstation/nextcloud/root:/var/www/html/" ] } env { } template { data= <