infrastructure/app/deployment/seafile.hcl

181 lines
4.5 KiB
HCL
Raw Normal View History

2019-06-01 14:02:49 +00:00
job "seafile" {
datacenters = ["dc1"]
type = "service"
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
}
group "main" {
count = 1
task "hack" {
driver = "docker"
config {
image = "alpine/socat:1.0.5"
network_mode = "host"
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"
]
port = 8085
address_mode = "driver"
name = "seafhttp"
check {
type = "tcp"
port = 8085
address_mode = "driver"
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 {
image = "superboum/amd64_seafile:v6"
2020-10-28 14:09:51 +00:00
network_mode = "host"
## 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-07-05 21:15:05 +00:00
memory = 512
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-10-28 14:09:51 +00:00
port = 8000
address_mode = "driver"
2019-06-01 14:02:49 +00:00
name = "seahub"
check {
type = "tcp"
2020-10-28 14:09:51 +00:00
port = 8000
address_mode = "driver"
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-10-28 14:09:51 +00:00
port = 8084
address_mode = "driver"
2019-06-01 14:02:49 +00:00
name = "seafdav"
check {
type = "tcp"
2020-10-28 14:09:51 +00:00
port = 8084
address_mode = "driver"
2019-06-01 14:02:49 +00:00
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
artifact {
2020-02-11 21:36:45 +00:00
source = "http://127.0.0.1:8500/v1/kv/configuration/seafile/conf/ccnet.conf.tpl?raw"
destination = "secrets/conf/ccnet.conf.tpl"
mode = "file"
}
2020-02-15 15:02:16 +00:00
template {
source = "secrets/conf/ccnet.conf.tpl"
destination = "secrets/conf/ccnet.conf"
}
2020-02-15 15:02:16 +00:00
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"
}
2019-06-01 14:02:49 +00:00
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"
}
}
}
}