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

81 lines
1.7 KiB
HCL
Raw Normal View History

2022-05-06 09:43:49 +00:00
job "cryptpad" {
datacenters = ["neptune"]
2022-05-06 09:43:49 +00:00
type = "service"
2022-05-06 09:43:49 +00:00
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-10 13:17:55 +00:00
}
2022-05-06 09:43:49 +00:00
config {
image = "kokakiwi/cryptpad:2024.9.0"
2022-05-10 13:17:55 +00:00
ports = [ "http" ]
2022-05-06 09:43:49 +00:00
volumes = [
"/mnt/ssd/cryptpad:/mnt",
"secrets/config.js:/cryptpad/config.js",
2022-05-06 09:43:49 +00:00
]
}
env {
CRYPTPAD_CONFIG = "/cryptpad/config.js"
2022-05-06 09:43:49 +00:00
}
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",
"tricot-add-header Access-Control-Allow-Origin *",
"tricot-add-header Access-Control-Allow-Credentials true",
"d53-cname pad.deuxfleurs.fr",
"d53-cname pad-sandbox.deuxfleurs.fr",
2022-05-06 09:43:49 +00:00
]
check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}
}
}
}
}