orchestration-tests/nomad/media/caddy.nomad
Ian Fijolek 96ca3270fa Create a lot more host volumes
Some are NFS volumes and present on all devices
2022-04-04 22:20:19 -07:00

75 lines
1.2 KiB
HCL

job "multimedia" {
datacenters = ["dc1"]
type = "service"
group "multimedia" {
count = 1
network {
mode = "bridge"
port "web" {
host_network = "loopback"
to = 80
}
}
volume "media-read" {
type = "host"
read_only = true
source = "media-read"
}
service {
name = "library"
port = "web"
connect {
sidecar_service {
proxy {
local_service_port = 80
}
}
sidecar_task {
resources {
cpu = 50
memory = 50
}
}
}
tags = [
"traefik.enable=true",
"traefik.http.routers.library.entryPoints=websecure",
]
}
task "main" {
driver = "docker"
volume_mount {
volume = "media-read"
destination = "/mnt/media"
read_only = true
}
config {
image = "caddy"
args = [
"caddy",
"file-server",
"--root",
"/mnt/media",
"--browse",
]
ports = ["web"]
}
resources {
cpu = 50
memory = 250
}
}
}
}