aboutsummaryrefslogtreecommitdiff
path: root/app/deployment/seafile.hcl
diff options
context:
space:
mode:
Diffstat (limited to 'app/deployment/seafile.hcl')
-rw-r--r--app/deployment/seafile.hcl77
1 files changed, 61 insertions, 16 deletions
diff --git a/app/deployment/seafile.hcl b/app/deployment/seafile.hcl
index a44bf60..3af7db3 100644
--- a/app/deployment/seafile.hcl
+++ b/app/deployment/seafile.hcl
@@ -12,17 +12,64 @@ job "seafile" {
count = 1
network {
- port "seafile-frontend" { static = 8000 }
- port "seafile-seafhttp" { static = 8083 }
- port "seafile-dav" { static = 8084 }
- port "seafile-hack" { static = 8085 }
+ port "seafile-frontend_port" { static = 8000 }
+ port "seafile-seafhttp_port" { static = 8083 }
+ port "seafile-dav_port" { static = 8084 }
+ port "seafile-hack_port" { static = 8085 }
+ port "mariadb_port" { static = 3306 }
}
+ task "mariadb" {
+ driver = "docker"
+ config {
+ image = "superboum/amd64_mariadb:v4"
+ network_mode = "host"
+ command = "tail"
+ ports = [ "mariadb_port" ]
+ args = [
+ "-f", "/var/log/mysql/error.log",
+ ]
+ volumes = [
+ "/mnt/glusterfs/mariadb/main/server:/var/lib/mysql",
+ ]
+ }
+
+ template {
+ data = file("../config/configuration/mariadb/main/env.tpl")
+ destination = "secrets/env"
+ env = true
+ }
+
+ resources {
+ memory = 800
+ }
+
+ service {
+ tags = ["mariadb"]
+ port = "mariadb_port"
+ address_mode = "host"
+ name = "mariadb"
+ check {
+ type = "tcp"
+ port = "mariadb_port"
+ interval = "60s"
+ timeout = "5s"
+ check_restart {
+ limit = 3
+ grace = "90s"
+ ignore_warnings = false
+ }
+ }
+ }
+ }
+
+
task "hack" {
driver = "docker"
config {
image = "alpine/socat:1.0.5"
network_mode = "host"
+ ports = [ "seafile-hack_port" ]
command = "tcp6-listen:8085,fork,reuseaddr"
args = [ "tcp-connect:127.0.0.1:8083" ]
}
@@ -37,13 +84,12 @@ job "seafile" {
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefixStrip:/seafhttp"
]
- port = 8085
- address_mode = "driver"
+ port = "seafile-hack_port"
+ address_mode = "host"
name = "seafhttp"
check {
type = "tcp"
- port = 8085
- address_mode = "driver"
+ port = "seafile-hack_port"
interval = "60s"
timeout = "5s"
check_restart {
@@ -61,6 +107,7 @@ job "seafile" {
config {
image = "superboum/amd64_seafile:v6"
network_mode = "host"
+ ports = [ "seafile-frontend_port", "seafile-dav_port", "seafile-seafhttp_port" ]
## cmd + args are used for running an instance attachable for update
# command = "/bin/sleep"
@@ -91,13 +138,12 @@ job "seafile" {
"traefik.frontend.entryPoints=https,http",
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/"
]
- port = 8000
- address_mode = "driver"
+ port = "seafile-frontend_port"
+ address_mode = "host"
name = "seahub"
check {
type = "tcp"
- port = 8000
- address_mode = "driver"
+ port = "seafile-frontend_port"
interval = "60s"
timeout = "5s"
check_restart {
@@ -116,13 +162,12 @@ job "seafile" {
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/seafdav"
]
- port = 8084
- address_mode = "driver"
+ port = "seafile-dav_port"
+ address_mode = "host"
name = "seafdav"
check {
type = "tcp"
- port = 8084
- address_mode = "driver"
+ port = "seafile-dav_port"
interval = "60s"
timeout = "5s"
check_restart {