infrastructure/app/deployment/jitsi.hcl

235 lines
5.4 KiB
HCL
Raw Normal View History

2020-03-27 08:49:51 +00:00
job "jitsi" {
datacenters = ["dc1"]
type = "service"
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
}
group "core" {
2020-12-23 14:55:17 +00:00
network {
port "bosh_port" { }
port "ext_port" { static = 5347 }
port "xmpp_port" { static = 5222 }
port "https_port" { }
port "video1_port" { static = 8080 }
port "video2_port" { static = 10000 }
}
2020-03-27 08:49:51 +00:00
task "xmpp" {
driver = "docker"
config {
2020-12-23 14:55:17 +00:00
image = "superboum/amd64_jitsi_xmpp:v8"
ports = [ "bosh_port", "ext_port", "xmpp_port" ]
2020-03-27 08:49:51 +00:00
network_mode = "host"
}
2020-12-23 14:55:17 +00:00
template {
data = file("../config/configuration/jitsi/global_env.tpl")
destination = "secrets/global_env"
env = true
}
# --- secrets ---
2020-03-27 20:50:00 +00:00
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.deuxfleurs.fr.crt\" }}"
destination = "secrets/certs/auth.jitsi.deuxfleurs.fr.crt"
}
2020-12-23 14:55:17 +00:00
2020-03-27 20:50:00 +00:00
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.deuxfleurs.fr.key\" }}"
destination = "secrets/certs/auth.jitsi.deuxfleurs.fr.key"
}
2020-12-23 14:55:17 +00:00
2020-03-27 20:50:00 +00:00
template {
data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.crt\" }}"
destination = "secrets/certs/jitsi.deuxfleurs.fr.crt"
}
2020-12-23 14:55:17 +00:00
2020-03-27 20:50:00 +00:00
template {
data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.key\" }}"
destination = "secrets/certs/jitsi.deuxfleurs.fr.key"
}
2020-03-27 08:49:51 +00:00
resources {
cpu = 300
memory = 200
}
service {
2020-10-28 13:12:15 +00:00
tags = [ "jitsi", "bosh" ]
2020-12-23 14:55:17 +00:00
port = "bosh_port"
address_mode = "host"
2020-03-27 08:49:51 +00:00
name = "jitsi-xmpp-bosh"
check {
type = "tcp"
2020-12-23 14:55:17 +00:00
port = "bosh_port"
2020-03-27 08:49:51 +00:00
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
2020-10-28 13:12:15 +00:00
service {
tags = [ "jitsi", "ext" ]
2020-12-23 14:55:17 +00:00
port = "ext_port"
address_mode = "host"
2020-10-28 13:12:15 +00:00
name = "jitsi-ext"
}
service {
tags = [ "jitsi", "xmpp" ]
2020-12-23 14:55:17 +00:00
port = "xmpp_port"
address_mode = "host"
2020-10-28 13:12:15 +00:00
name = "jitsi-xmpp"
}
2020-03-27 08:49:51 +00:00
}
task "front" {
driver = "docker"
config {
2021-01-13 13:42:14 +00:00
image = "superboum/amd64_jitsi_meet:v3"
2020-03-27 08:49:51 +00:00
network_mode = "host"
2020-12-23 14:55:17 +00:00
ports = [ "https_port" ]
2020-03-27 08:49:51 +00:00
}
2020-12-23 14:55:17 +00:00
template {
data = file("../config/configuration/jitsi/global_env.tpl")
destination = "secrets/global_env"
env = true
}
# --- secrets ---
2020-03-27 20:50:00 +00:00
template {
2020-03-27 20:54:11 +00:00
data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.crt\" }}"
destination = "secrets/certs/jitsi.deuxfleurs.fr.crt"
2020-03-27 20:50:00 +00:00
}
template {
2020-03-27 20:54:11 +00:00
data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.key\" }}"
destination = "secrets/certs/jitsi.deuxfleurs.fr.key"
2020-03-27 20:50:00 +00:00
}
2020-03-27 08:49:51 +00:00
resources {
cpu = 300
memory = 200
}
service {
tags = [
"jitsi",
"traefik.enable=true",
"traefik.frontend.entryPoints=https,http",
2020-03-27 20:50:00 +00:00
"traefik.frontend.rule=Host:jitsi.deuxfleurs.fr;PathPrefix:/",
"traefik.protocol=https"
2020-03-27 08:49:51 +00:00
]
2020-12-23 14:55:17 +00:00
port = "https_port"
address_mode = "host"
2020-03-27 08:49:51 +00:00
name = "jitsi-front-https"
check {
type = "tcp"
2020-12-23 14:55:17 +00:00
port = "https_port"
2020-03-27 08:49:51 +00:00
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
}
task "jicofo" {
driver = "docker"
config {
2021-01-13 13:42:14 +00:00
image = "superboum/amd64_jitsi_conference_focus:v6"
2020-03-27 08:49:51 +00:00
network_mode = "host"
}
2020-12-23 14:55:17 +00:00
template {
data = file("../config/configuration/jitsi/global_env.tpl")
destination = "secrets/global_env"
env = true
}
#--- secrets ---
2020-03-27 20:50:00 +00:00
template {
data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.crt\" }}"
destination = "secrets/certs/jitsi.deuxfleurs.fr.crt"
}
2020-12-23 14:55:17 +00:00
2020-03-27 20:50:00 +00:00
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.deuxfleurs.fr.crt\" }}"
destination = "secrets/certs/auth.jitsi.deuxfleurs.fr.crt"
}
2020-03-27 08:49:51 +00:00
resources {
cpu = 300
2020-06-14 09:48:53 +00:00
memory = 400
2020-03-27 08:49:51 +00:00
}
}
task "videobridge" {
driver = "docker"
config {
2021-01-13 13:42:14 +00:00
image = "superboum/amd64_jitsi_videobridge:v16"
2020-03-27 08:49:51 +00:00
network_mode = "host"
2020-12-23 14:55:17 +00:00
ports = [ "video1_port", "video2_port" ]
2020-03-28 07:39:02 +00:00
ulimit {
nofile = "1048576:1048576"
nproc = "65536:65536"
}
2020-03-27 08:49:51 +00:00
}
2020-04-02 18:24:50 +00:00
env {
2020-04-05 08:41:24 +00:00
#JITSI_DEBUG = 1
JITSI_VIDEO_TCP = 8080
2020-12-02 11:28:19 +00:00
VIDEOBRIDGE_MAX_MEMORY = "1450m"
2020-04-02 18:24:50 +00:00
}
2020-03-27 20:50:00 +00:00
template {
2020-12-23 14:55:17 +00:00
data = file("../config/configuration/jitsi/global_env.tpl")
2020-03-27 20:50:00 +00:00
destination = "secrets/global_env"
env = true
}
2020-03-27 08:49:51 +00:00
resources {
2020-03-28 07:39:02 +00:00
cpu = 900
memory = 1500
2020-03-27 08:49:51 +00:00
}
service {
2020-10-28 13:12:15 +00:00
tags = [ "jitsi", "(diplonat (tcp_port 8080))" ]
2020-12-23 14:55:17 +00:00
port = "video1_port"
address_mode = "host"
2020-03-27 08:49:51 +00:00
name = "jitsi-videobridge-video1"
check {
type = "tcp"
2020-12-23 14:55:17 +00:00
port = "video1_port"
2020-03-27 08:49:51 +00:00
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
2020-10-28 13:12:15 +00:00
service {
tags = [ "jitsi", "(diplonat (udp_port 10000))" ]
2020-12-23 14:55:17 +00:00
port = "video2_port"
address_mode = "host"
2020-10-28 13:12:15 +00:00
name = "jitsi-videobridge-video2"
}
}
2020-03-27 08:49:51 +00:00
}
}