2021-03-31 21:16:25 +00:00
|
|
|
job "nextcloud" {
|
|
|
|
datacenters = ["columbia"]
|
|
|
|
region = "global"
|
|
|
|
type = "service"
|
|
|
|
|
2021-07-30 03:51:21 +00:00
|
|
|
constraint {
|
|
|
|
attribute = "${meta.storage_optimized}"
|
|
|
|
value = "true"
|
|
|
|
}
|
|
|
|
|
2021-03-31 21:16:25 +00:00
|
|
|
update {
|
|
|
|
stagger = "30s"
|
|
|
|
max_parallel = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
group "nextcloud" {
|
|
|
|
count = 1
|
|
|
|
|
|
|
|
task "nextcloud" {
|
|
|
|
vault {
|
|
|
|
policies = ["default", "ansible"]
|
|
|
|
change_mode = "restart"
|
|
|
|
}
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2022-06-25 14:19:15 +00:00
|
|
|
image = "docker-repo.service.masked.name:5000/nextcloud:latest"
|
2021-03-31 21:16:25 +00:00
|
|
|
ports = ["nextcloud"]
|
|
|
|
volumes = [
|
|
|
|
"/mnt/raid/nextcloud/:/var/www/html"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "nextcloud"
|
|
|
|
port = "nextcloud"
|
|
|
|
|
|
|
|
check {
|
|
|
|
name = "nextcloud"
|
|
|
|
type = "tcp"
|
|
|
|
interval = "10s"
|
|
|
|
timeout = "2s"
|
|
|
|
address_mode = "driver"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
{{- with secret "pki_int/issue/masked-dot-name" "common_name=nextcloud.service.masked.name" "alt_names=nextcloud.service.columbia.masked.name" -}}
|
|
|
|
{{- .Data.certificate -}}
|
|
|
|
{{- end -}}
|
|
|
|
EOH
|
|
|
|
destination = "${NOMAD_SECRETS_DIR}/nextcloud.crt"
|
|
|
|
change_mode = "restart"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
{{- with secret "pki_int/issue/masked-dot-name" "common_name=nextcloud.service.masked.name" "alt_names=nextcloud.service.columbia.masked.name" -}}
|
|
|
|
{{- .Data.private_key -}}
|
|
|
|
{{- end -}}
|
|
|
|
EOH
|
|
|
|
destination = "${NOMAD_SECRETS_DIR}/nextcloud.key"
|
|
|
|
change_mode = "restart"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2021-06-06 21:51:57 +00:00
|
|
|
cpu = 5000
|
2021-03-31 21:16:25 +00:00
|
|
|
memory = 2560
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
|
|
|
port "nextcloud" {
|
|
|
|
to = 80
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|