infrastructure/app/im/deploy/im.hcl

186 lines
4.5 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-09-13 16:52:12 +00:00
image = "superboum/amd64_synapse:v46"
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 = 2000
2019-06-01 14:02:49 +00:00
}
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,/_synapse",
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
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-09-13 16:52:12 +00:00
image = "superboum/amd64_riotweb:v24"
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
}
}
}
}
}
}