This repository has been archived on 2023-03-15. You can view files and clone it, but cannot push or open issues or pull requests.
infrastructure/app/im/deploy/im.hcl

266 lines
6.3 KiB
HCL
Raw Normal View History

job "im" {
2019-06-01 14:02:49 +00:00
datacenters = ["dc1"]
type = "service"
2020-12-18 09:32:44 +00:00
priority = 60
2019-06-01 14:02:49 +00:00
group "matrix" {
count = 1
network {
port "client_port" { static = 8008 }
port "federation_port" { static = 8448 }
}
2019-06-01 14:02:49 +00:00
task "synapse" {
driver = "docker"
config {
2021-06-04 17:48:50 +00:00
image = "superboum/amd64_synapse:v45"
network_mode = "host"
2019-06-01 14:02:49 +00:00
readonly_rootfs = true
ports = [ "client_port", "federation_port" ]
2019-06-01 14:02:49 +00:00
command = "python"
args = [
"-m", "synapse.app.homeserver",
"-n",
"-c", "/etc/matrix-synapse/homeserver.yaml"
]
volumes = [
"secrets/conf:/etc/matrix-synapse",
"/mnt/glusterfs/chat/matrix/synapse/media:/var/lib/matrix-synapse/media",
"/mnt/glusterfs/chat/matrix/synapse/uploads:/var/lib/matrix-synapse/uploads",
"/tmp/synapse-logs:/var/log/matrix-synapse",
"/tmp/synapse:/tmp"
]
}
template {
data = file("../config/synapse/homeserver.yaml")
2019-06-01 14:02:49 +00:00
destination = "secrets/conf/homeserver.yaml"
}
2020-02-28 19:08:37 +00:00
template {
data = file("../config/easybridge/registration.yaml.tpl")
2020-02-28 19:08:37 +00:00
destination = "secrets/conf/easybridge_registration.yaml"
}
2019-06-01 14:02:49 +00:00
template {
data = file("../config/synapse/log.yaml")
2019-06-01 14:02:49 +00:00
destination = "secrets/conf/log.yaml"
}
2019-06-01 14:02:49 +00:00
template {
data = file("../config/synapse/conf.d/server_name.yaml")
2019-06-01 14:02:49 +00:00
destination = "secrets/conf/server_name.yaml"
}
2019-06-01 14:02:49 +00:00
template {
data = file("../config/synapse/conf.d/report_stats.yaml")
2019-06-01 14:02:49 +00:00
destination = "secrets/conf/report_stats.yaml"
}
# --- secrets ---
2019-06-01 14:02:49 +00:00
template {
data = "{{ key \"secrets/chat/synapse/homeserver.tls.crt\" }}"
destination = "secrets/conf/homeserver.tls.crt"
}
2019-06-01 14:02:49 +00:00
template {
data = "{{ key \"secrets/chat/synapse/homeserver.tls.dh\" }}"
destination = "secrets/conf/homeserver.tls.dh"
}
2019-06-01 14:02:49 +00:00
template {
data = "{{ key \"secrets/chat/synapse/homeserver.tls.key\" }}"
destination = "secrets/conf/homeserver.tls.key"
}
2019-06-01 14:02:49 +00:00
template {
data = "{{ key \"secrets/chat/synapse/homeserver.signing.key\" }}"
destination = "secrets/conf/homeserver.signing.key"
}
env {
SYNAPSE_CACHE_FACTOR = 1
}
resources {
cpu = 1000
memory = 4000
}
service {
name = "synapse-client"
port = "client_port"
2020-12-24 09:01:42 +00:00
address_mode = "host"
2019-06-01 14:02:49 +00:00
tags = [
"matrix",
"traefik.enable=true",
"traefik.frontend.entryPoints=https",
"traefik.frontend.rule=Host:im.deuxfleurs.fr;PathPrefix:/_matrix",
2020-05-05 14:14:01 +00:00
"traefik.frontend.headers.customResponseHeaders=Access-Control-Allow-Origin: *",
"traefik.frontend.priority=100"
2019-06-01 14:02:49 +00:00
]
check {
type = "tcp"
port = "client_port"
2019-06-01 14:02:49 +00:00
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
service {
name = "synapse-federation"
port = "federation_port"
2020-12-24 09:01:42 +00:00
address_mode = "host"
tags = [
"matrix",
"traefik.enable=true",
"traefik.frontend.entryPoints=https",
"traefik.frontend.rule=Host:deuxfleurs.fr;PathPrefix:/_matrix",
"traefik.frontend.priority=100"
]
}
2019-06-01 14:02:49 +00:00
}
}
2020-02-28 19:08:37 +00:00
group "easybridge" {
count = 1
network {
port "api_port" {
static = 8321
to = 8321
}
port "web_port" { to = 8281 }
}
2020-02-28 19:08:37 +00:00
task "easybridge" {
driver = "docker"
config {
2021-06-01 21:44:57 +00:00
image = "lxpz/easybridge_amd64:35"
ports = [ "api_port", "web_port" ]
2020-02-28 19:08:37 +00:00
volumes = [
"secrets/conf:/data"
2020-02-28 19:08:37 +00:00
]
2020-03-02 20:56:45 +00:00
args = [ "./easybridge", "-config", "/data/config.json" ]
2020-02-28 19:08:37 +00:00
}
template {
data = file("../config/easybridge/registration.yaml.tpl")
2020-02-28 19:08:37 +00:00
destination = "secrets/conf/registration.yaml"
}
template {
data = file("../config/easybridge/config.json.tpl")
2020-02-28 19:08:37 +00:00
destination = "secrets/conf/config.json"
}
resources {
2021-03-08 15:34:41 +00:00
memory = 250
cpu = 100
2020-02-28 19:08:37 +00:00
}
service {
name = "easybridge-api"
tags = ["easybridge-api"]
port = "api_port"
address_mode = "host"
check {
type = "tcp"
port = "api_port"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
service {
name = "easybridge-web"
tags = [
"easybridge-web",
"traefik.enable=true",
"traefik.frontend.entryPoints=https,http",
"traefik.frontend.rule=Host:easybridge.deuxfleurs.fr",
]
port = "web_port"
address_mode = "host"
check {
type = "tcp"
port = "web_port"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
}
}
2019-06-01 14:02:49 +00:00
group "riotweb" {
count = 1
network {
port "web_port" { to = 8043 }
}
2019-06-01 14:02:49 +00:00
task "server" {
driver = "docker"
config {
2021-05-18 13:26:41 +00:00
image = "superboum/amd64_riotweb:v23"
ports = [ "web_port" ]
2019-06-01 14:02:49 +00:00
volumes = [
"secrets/config.json:/srv/http/config.json"
2019-06-01 14:02:49 +00:00
]
}
template {
data = file("../config/riot_web/config.json")
2019-06-01 14:02:49 +00:00
destination = "secrets/config.json"
}
resources {
memory = 21
}
service {
tags = [
"webstatic",
"traefik.enable=true",
"traefik.frontend.entryPoints=https",
"traefik.frontend.rule=Host:im.deuxfleurs.fr,riot.deuxfleurs.fr;PathPrefix:/",
"traefik.frontend.priority=10"
2019-06-01 14:02:49 +00:00
]
port = "web_port"
address_mode = "host"
name = "webstatic"
check {
type = "tcp"
port = "web_port"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
}
}
}