aboutsummaryrefslogtreecommitdiff
path: root/app/deployment/seafile.hcl
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-09-13 12:03:07 +0200
committerQuentin <quentin@deuxfleurs.fr>2020-09-13 12:03:07 +0200
commit484c3fe667cd8c5a647256cb78f05c8a39b835b1 (patch)
tree7be3c868ce1d0e0c96125a4c94cadce429be9e1d /app/deployment/seafile.hcl
parent0550647b9348d1e36431400e0832b4340564c658 (diff)
parentd5bfc38fe826aa12f46de64790195cc8e76756de (diff)
downloadinfrastructure-484c3fe667cd8c5a647256cb78f05c8a39b835b1.tar.gz
infrastructure-484c3fe667cd8c5a647256cb78f05c8a39b835b1.zip
Merge branch 'feature/rebase'
Diffstat (limited to 'app/deployment/seafile.hcl')
-rw-r--r--app/deployment/seafile.hcl174
1 files changed, 174 insertions, 0 deletions
diff --git a/app/deployment/seafile.hcl b/app/deployment/seafile.hcl
new file mode 100644
index 0000000..e22699c
--- /dev/null
+++ b/app/deployment/seafile.hcl
@@ -0,0 +1,174 @@
+job "seafile" {
+ datacenters = ["dc1"]
+ type = "service"
+
+ constraint {
+ attribute = "${attr.cpu.arch}"
+ value = "amd64"
+ }
+
+ group "main" {
+ count = 1
+ task "server" {
+ driver = "docker"
+ config {
+ image = "superboum/amd64_seafile:v6"
+
+ ## cmd + args are used for running an instance attachable for update
+ # command = "/bin/sleep"
+ # args = ["999999"]
+
+ port_map {
+ seahub_port = 8000
+ seafdav_port = 8084
+ seafhttp_port = 8082
+ }
+
+ mounts = [
+ {
+ type = "bind"
+ source = "/mnt/glusterfs/seafile"
+ target = "/mnt/seafile-data"
+ }
+ ]
+
+ volumes = [
+ "secrets/conf:/srv/webstore/conf",
+ "secrets/ccnet:/srv/webstore/ccnet"
+ ]
+ }
+
+ resources {
+ memory = 512
+ network {
+ port "seahub_port" {}
+ port "seafhttp_port" {}
+ port "seafdav_port" {}
+ }
+ }
+
+ service {
+ tags = [
+ "seafile",
+ "traefik.enable=true",
+ "traefik.frontend.entryPoints=https,http",
+ "traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/"
+ ]
+ port = "seahub_port"
+ address_mode = "host"
+ name = "seahub"
+ check {
+ type = "tcp"
+ port = "seahub_port"
+ interval = "60s"
+ timeout = "5s"
+ check_restart {
+ limit = 3
+ grace = "90s"
+ ignore_warnings = false
+ }
+ }
+ }
+
+ service {
+ tags = [
+ "seafile",
+ "traefik.enable=true",
+ "traefik.frontend.entryPoints=https,http",
+ "traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefixStrip:/seafhttp"
+
+ ]
+ port = "seafhttp_port"
+ address_mode = "host"
+ name = "seafhttp"
+ check {
+ type = "tcp"
+ port = "seafhttp_port"
+ interval = "60s"
+ timeout = "5s"
+ check_restart {
+ limit = 3
+ grace = "90s"
+ ignore_warnings = false
+ }
+ }
+ }
+
+ service {
+ tags = [
+ "seafile",
+ "traefik.enable=true",
+ "traefik.frontend.entryPoints=https,http",
+ "traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/seafdav"
+
+ ]
+ port = "seafdav_port"
+ address_mode = "host"
+ name = "seafdav"
+ check {
+ type = "tcp"
+ port = "seafdav_port"
+ interval = "60s"
+ timeout = "5s"
+ check_restart {
+ limit = 3
+ grace = "90s"
+ ignore_warnings = false
+ }
+ }
+ }
+
+ artifact {
+ source = "http://127.0.0.1:8500/v1/kv/configuration/seafile/conf/ccnet.conf.tpl?raw"
+ destination = "secrets/conf/ccnet.conf.tpl"
+ mode = "file"
+ }
+ template {
+ source = "secrets/conf/ccnet.conf.tpl"
+ destination = "secrets/conf/ccnet.conf"
+ }
+
+ artifact {
+ source = "http://127.0.0.1:8500/v1/kv/configuration/seafile/conf/seafile.conf.tpl?raw"
+ destination = "secrets/conf/seafile.conf.tpl"
+ mode = "file"
+ }
+ template {
+ source = "secrets/conf/seafile.conf.tpl"
+ destination = "secrets/conf/seafile.conf"
+ }
+
+ artifact {
+ source = "http://127.0.0.1:8500/v1/kv/configuration/seafile/conf/seahub_settings.py.tpl?raw"
+ destination = "secrets/conf/seahub_settings.py.tpl"
+ mode = "file"
+ }
+ template {
+ source = "secrets/conf/seahub_settings.py.tpl"
+ destination = "secrets/conf/seahub_settings.py"
+ }
+
+ template {
+ data = "{{ key \"configuration/seafile/ccnet/mykey.peer\" }}"
+ destination = "secrets/ccnet/mykey.peer"
+ }
+ template {
+ data = "{{ key \"configuration/seafile/ccnet/seafile.ini\" }}"
+ destination = "secrets/ccnet/seafile.ini"
+ }
+ template {
+ data = "{{ key \"configuration/seafile/conf/mykey.peer\" }}"
+ destination = "secrets/conf/mykey.peer"
+ }
+ template {
+ data = "{{ key \"configuration/seafile/conf/seafdav.conf\" }}"
+ destination = "secrets/conf/seafdav.conf"
+ }
+ template {
+ data = "{{ key \"configuration/seafile/conf/gunicorn.conf\" }}"
+ destination = "secrets/conf/gunicorn.conf"
+ }
+ }
+ }
+}
+