61 lines
976 B
HCL
61 lines
976 B
HCL
job "multimedia" {
|
|
datacenters = ["dc1"]
|
|
type = "service"
|
|
|
|
group "multimedia" {
|
|
count = 1
|
|
|
|
network {
|
|
mode = "bridge"
|
|
port "web" {
|
|
host_network = "wesher"
|
|
to = 80
|
|
}
|
|
}
|
|
|
|
volume "media-read" {
|
|
type = "host"
|
|
read_only = true
|
|
source = "media-read"
|
|
}
|
|
|
|
service {
|
|
name = "library"
|
|
provider = "nomad"
|
|
port = "web"
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|