2019-06-01 14:02:49 +00:00
|
|
|
job "seafile" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
2020-12-18 09:32:44 +00:00
|
|
|
priority = 10
|
2019-06-01 14:02:49 +00:00
|
|
|
|
|
|
|
constraint {
|
|
|
|
attribute = "${attr.cpu.arch}"
|
|
|
|
value = "amd64"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "main" {
|
|
|
|
count = 1
|
2020-12-22 13:31:42 +00:00
|
|
|
|
|
|
|
network {
|
2020-12-25 10:16:11 +00:00
|
|
|
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 }
|
2020-12-22 13:31:42 +00:00
|
|
|
}
|
|
|
|
|
2020-12-25 10:16:11 +00:00
|
|
|
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 {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/mariadb/main/env.tpl")
|
2020-12-25 10:16:11 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-10-28 21:57:41 +00:00
|
|
|
task "hack" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
|
|
|
image = "alpine/socat:1.0.5"
|
|
|
|
network_mode = "host"
|
2020-12-25 10:16:11 +00:00
|
|
|
ports = [ "seafile-hack_port" ]
|
2020-10-28 21:57:41 +00:00
|
|
|
command = "tcp6-listen:8085,fork,reuseaddr"
|
|
|
|
args = [ "tcp-connect:127.0.0.1:8083" ]
|
|
|
|
}
|
|
|
|
resources {
|
|
|
|
memory = 10
|
|
|
|
}
|
|
|
|
service {
|
|
|
|
tags = [
|
|
|
|
"seafile",
|
|
|
|
"traefik.enable=true",
|
|
|
|
"traefik.frontend.entryPoints=https,http",
|
|
|
|
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefixStrip:/seafhttp"
|
|
|
|
|
|
|
|
]
|
2020-12-25 10:16:11 +00:00
|
|
|
port = "seafile-hack_port"
|
|
|
|
address_mode = "host"
|
2020-10-28 21:57:41 +00:00
|
|
|
name = "seafhttp"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
2020-12-25 10:16:11 +00:00
|
|
|
port = "seafile-hack_port"
|
2020-10-28 21:57:41 +00:00
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
task "server" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2019-10-26 19:16:24 +00:00
|
|
|
image = "superboum/amd64_seafile:v6"
|
2020-10-28 14:09:51 +00:00
|
|
|
network_mode = "host"
|
2020-12-25 10:16:11 +00:00
|
|
|
ports = [ "seafile-frontend_port", "seafile-dav_port", "seafile-seafhttp_port" ]
|
2019-10-26 19:16:24 +00:00
|
|
|
|
|
|
|
## cmd + args are used for running an instance attachable for update
|
|
|
|
# command = "/bin/sleep"
|
|
|
|
# args = ["999999"]
|
|
|
|
|
2020-07-05 18:36:16 +00:00
|
|
|
mounts = [
|
|
|
|
{
|
|
|
|
type = "bind"
|
|
|
|
source = "/mnt/glusterfs/seafile"
|
|
|
|
target = "/mnt/seafile-data"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
volumes = [
|
|
|
|
"secrets/conf:/srv/webstore/conf",
|
|
|
|
"secrets/ccnet:/srv/webstore/ccnet"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
2020-11-03 20:12:01 +00:00
|
|
|
memory = 600
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
tags = [
|
|
|
|
"seafile",
|
|
|
|
"traefik.enable=true",
|
|
|
|
"traefik.frontend.entryPoints=https,http",
|
|
|
|
"traefik.frontend.rule=Host:cloud.deuxfleurs.fr;PathPrefix:/"
|
|
|
|
]
|
2020-12-25 10:16:11 +00:00
|
|
|
port = "seafile-frontend_port"
|
|
|
|
address_mode = "host"
|
2019-06-01 14:02:49 +00:00
|
|
|
name = "seahub"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
2020-12-25 10:16:11 +00:00
|
|
|
port = "seafile-frontend_port"
|
2019-06-01 14:02:49 +00:00
|
|
|
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"
|
|
|
|
|
|
|
|
]
|
2020-12-25 10:16:11 +00:00
|
|
|
port = "seafile-dav_port"
|
|
|
|
address_mode = "host"
|
2019-06-01 14:02:49 +00:00
|
|
|
name = "seafdav"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
2020-12-25 10:16:11 +00:00
|
|
|
port = "seafile-dav_port"
|
2019-06-01 14:02:49 +00:00
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-22 13:31:42 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/conf/ccnet.conf.tpl")
|
2020-02-11 20:52:57 +00:00
|
|
|
destination = "secrets/conf/ccnet.conf"
|
|
|
|
}
|
|
|
|
|
2020-02-15 15:02:16 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/conf/seafile.conf.tpl")
|
2020-02-15 15:02:16 +00:00
|
|
|
destination = "secrets/conf/seafile.conf"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/conf/seahub_settings.py.tpl")
|
2020-02-15 15:02:16 +00:00
|
|
|
destination = "secrets/conf/seahub_settings.py"
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/ccnet/seafile.ini")
|
2020-12-22 13:31:42 +00:00
|
|
|
destination = "secrets/ccnet/seafile.ini"
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/conf/seafdav.conf")
|
2020-12-22 13:31:42 +00:00
|
|
|
destination = "secrets/conf/seafdav.conf"
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/conf/gunicorn.conf")
|
2020-12-22 13:31:42 +00:00
|
|
|
destination = "secrets/conf/gunicorn.conf"
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
2020-12-22 13:31:42 +00:00
|
|
|
|
|
|
|
# ---- secrets ----
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
2020-12-22 13:40:04 +00:00
|
|
|
data = "{{ key \"secrets/seafile/conf/mykey.peer\" }}"
|
2020-12-22 13:31:42 +00:00
|
|
|
destination = "secrets/ccnet/mykey.peer"
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
2020-12-22 13:31:42 +00:00
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
2020-12-22 13:40:04 +00:00
|
|
|
data = "{{ key \"secrets/seafile/conf/mykey.peer\" }}"
|
2020-12-22 13:31:42 +00:00
|
|
|
destination = "secrets/conf/mykey.peer"
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|