nixcfg/cluster/prod/app/cryptpad/deploy/cryptpad.hcl

77 lines
1.6 KiB
HCL
Raw Normal View History

2022-05-06 09:43:49 +00:00
job "cryptpad" {
datacenters = ["neptune"]
type = "service"
group "cryptpad" {
count = 1
network {
2022-05-10 13:17:55 +00:00
port "http" {
2022-05-06 09:43:49 +00:00
to = 3000
}
}
restart {
attempts = 10
delay = "30s"
}
task "main" {
driver = "docker"
2022-05-10 13:17:55 +00:00
constraint {
attribute = "${attr.unique.hostname}"
operator = "="
value = "courgette"
}
2022-05-06 09:43:49 +00:00
config {
2022-05-10 13:17:55 +00:00
image = "superboum/cryptpad:0p3s44hjh4s1x55kbwkmywmwmx4wfyb8"
ports = [ "http" ]
2022-05-06 09:43:49 +00:00
volumes = [
"/mnt/storage/cryptpad:/mnt",
"secrets/config.js:/etc/cryptpad/config.js",
]
}
env {
CRYPTPAD_CONFIG = "/etc/cryptpad/config.js"
}
template {
data = file("../config/config.js")
destination = "secrets/config.js"
}
2022-05-10 13:17:55 +00:00
/* Disabled because it requires modifications to the docker image and I do not want to invest the time yet
template {
data = file("../config/application_config.js")
destination = "secrets/config.js"
}
*/
2022-05-06 09:43:49 +00:00
resources {
memory = 1000
cpu = 500
}
service {
name = "cryptpad"
2022-05-10 13:17:55 +00:00
port = "http"
2022-05-06 09:43:49 +00:00
tags = [
"tricot pad.deuxfleurs.fr",
"tricot pad-sandbox.deuxfleurs.fr",
2022-05-06 10:22:59 +00:00
"tricot-add-header Cross-Origin-Resource-Policy cross-origin",
"tricot-add-header Cross-Origin-Embedder-Policy require-corp",
2022-05-06 09:43:49 +00:00
]
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
}
}
}