45 lines
964 B
HCL
45 lines
964 B
HCL
module "wishlist" {
|
|
source = "./service"
|
|
|
|
name = "wishlist"
|
|
image = "wingysam/christmas-community:latest"
|
|
|
|
ingress = true
|
|
service_port = 80
|
|
use_wesher = var.use_wesher
|
|
|
|
host_volumes = [
|
|
{
|
|
name = "christmas-community"
|
|
dest = "/data"
|
|
read_only = false
|
|
},
|
|
]
|
|
|
|
templates = [
|
|
{
|
|
data = <<EOF
|
|
{{ with nomadVar "nomad/jobs/wishlist" -}}
|
|
GUEST_PASSWORD={{ .guest_password }}
|
|
{{ end -}}
|
|
{{ with nomadService "traefik" -}}
|
|
{{- $last := len . | subtract 1 -}}
|
|
{{- $services := . -}}
|
|
TRUST_PROXY={{ range $i := loop $last -}}
|
|
{{- with index $services $i }}{{ .Address }},{{ end -}}
|
|
{{- end -}}
|
|
{{- with index . $last }}{{ .Address }}{{ end -}}
|
|
{{- end }}
|
|
EOF
|
|
dest = "env"
|
|
dest_prefix = "$${NOMAD_SECRETS_DIR}/"
|
|
env = true
|
|
},
|
|
]
|
|
|
|
resources = {
|
|
cpu = 100
|
|
memory = 200
|
|
}
|
|
}
|