aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/cryptpad/deploy/cryptpad.hcl
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-08-24 15:42:47 +0200
committerAlex Auvolat <alex@adnab.me>2022-08-24 15:42:47 +0200
commit2e8923b383eb06c53261eee8e5c442b857fb67e4 (patch)
tree0ad148f75f7b54dfed2dbac8f43f6df9badc502a /cluster/prod/app/cryptpad/deploy/cryptpad.hcl
parent9848f3090f77363a2fda0f9fa673ebcf1fb8228c (diff)
downloadnixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.tar.gz
nixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.zip
Move app files into cluster subdirectories; add prod garage
Diffstat (limited to 'cluster/prod/app/cryptpad/deploy/cryptpad.hcl')
-rw-r--r--cluster/prod/app/cryptpad/deploy/cryptpad.hcl75
1 files changed, 75 insertions, 0 deletions
diff --git a/cluster/prod/app/cryptpad/deploy/cryptpad.hcl b/cluster/prod/app/cryptpad/deploy/cryptpad.hcl
new file mode 100644
index 0000000..726fe5a
--- /dev/null
+++ b/cluster/prod/app/cryptpad/deploy/cryptpad.hcl
@@ -0,0 +1,75 @@
+job "cryptpad" {
+ datacenters = ["neptune"]
+ type = "service"
+
+ group "cryptpad" {
+ count = 1
+
+ network {
+ port "http" {
+ to = 3000
+ }
+ }
+
+ restart {
+ attempts = 10
+ delay = "30s"
+ }
+
+ task "main" {
+ driver = "docker"
+
+ constraint {
+ attribute = "${attr.unique.hostname}"
+ operator = "="
+ value = "courgette"
+ }
+
+ config {
+ image = "superboum/cryptpad:0p3s44hjh4s1x55kbwkmywmwmx4wfyb8"
+ ports = [ "http" ]
+
+ 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"
+ }
+
+ /* 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"
+ }
+ */
+
+ resources {
+ memory = 1000
+ cpu = 500
+ }
+
+ service {
+ port = "http"
+ tags = [
+ "tricot pad.deuxfleurs.fr",
+ "tricot pad-sandbox.deuxfleurs.fr",
+ "tricot-add-header Cross-Origin-Resource-Policy cross-origin",
+ "tricot-add-header Cross-Origin-Embedder-Policy require-corp",
+ ]
+ check {
+ type = "http"
+ path = "/"
+ interval = "10s"
+ timeout = "2s"
+ }
+ }
+ }
+ }
+}