summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2023-10-04 23:40:37 +0200
committerMathias Magnusson <mathias@magnusson.space>2023-10-04 23:40:37 +0200
commite8838d99f1f066822bfced3204bce9d5662fd08a (patch)
tree66d87014b2b99b625ff01e89f5843ce09455ddac
parent2ecfba926865cf4edb43dcfa7c003eb7326fb958 (diff)
downloadgarm-e8838d99f1f066822bfced3204bce9d5662fd08a.tar.gz
Add syncthing
-rw-r--r--jobs/syncthing.nomad.hcl52
-rw-r--r--nomad.tmpl.hcl4
2 files changed, 56 insertions, 0 deletions
diff --git a/jobs/syncthing.nomad.hcl b/jobs/syncthing.nomad.hcl
new file mode 100644
index 0000000..98f554d
--- /dev/null
+++ b/jobs/syncthing.nomad.hcl
@@ -0,0 +1,52 @@
+job "syncthing" {
+ group "syncthing" {
+ count = 1
+
+ network {
+ port "http" {
+ to = 8384
+ }
+ port "sync" {
+ static = 22000
+ }
+ port "discovery" {
+ static = 21027
+ }
+ }
+
+ service {
+ name = "syncthing-web"
+ port = "http"
+ provider = "nomad"
+
+ tags = [
+ "nginx.hostname=syncthing.magnusson.space",
+ "nginx.certname=magnusson.space",
+ ]
+ }
+
+ volume "syncthing" {
+ type = "host"
+ source = "syncthing"
+ }
+
+ task "syncthing" {
+ driver = "docker"
+
+ resources {
+ cpu = 100
+ memory = 150
+ }
+
+ volume_mount {
+ volume = "syncthing"
+ destination = "/config"
+ }
+
+ config {
+ image = "linuxserver/syncthing:1.24.0"
+ ports = ["sync", "discovery", "http"]
+ }
+ }
+ }
+}
diff --git a/nomad.tmpl.hcl b/nomad.tmpl.hcl
index f098816..7df5416 100644
--- a/nomad.tmpl.hcl
+++ b/nomad.tmpl.hcl
@@ -29,6 +29,10 @@ client {
host_volume "faktura-settings" {
path = "/var/www/faktura"
}
+
+ host_volume "syncthing" {
+ path = "/var/local/syncthing"
+ }
}
acl {