nixcfg/cluster/prod/app/jitsi/deploy/jitsi.hcl

281 lines
6.7 KiB
HCL
Raw Permalink Normal View History

2022-08-23 16:00:07 +00:00
job "jitsi" {
2023-08-31 16:08:16 +00:00
datacenters = ["neptune", "scorpio"]
2022-08-23 16:00:07 +00:00
type = "service"
priority = 50
2022-08-23 16:00:07 +00:00
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
}
2023-02-02 07:24:45 +00:00
group "control_plane" {
2022-08-23 16:00:07 +00:00
network {
port "bosh_port" { }
2023-02-02 07:48:19 +00:00
port "xmpp_port" { static = 5223 }
2022-08-23 16:00:07 +00:00
port "https_port" { }
}
task "xmpp" {
driver = "docker"
config {
2024-09-12 17:59:51 +00:00
image = "superboum/amd64_jitsi_xmpp:v12"
2022-08-23 16:00:07 +00:00
ports = [ "bosh_port", "xmpp_port" ]
network_mode = "host"
volumes = [
"secrets/prosody.cfg.lua:/etc/prosody/prosody.cfg.lua",
"secrets/certs/auth.jitsi.crt:/var/lib/prosody/auth.jitsi.crt",
"secrets/certs/auth.jitsi.key:/var/lib/prosody/auth.jitsi.key",
"secrets/certs/jitsi.crt:/var/lib/prosody/jitsi.crt",
"secrets/certs/jitsi.key:/var/lib/prosody/jitsi.key"
]
}
template {
data = <<EOF
JICOFO_AUTH_PASSWORD={{ key "secrets/jitsi/jicofo_pass" | trimSpace }}
JVB_AUTH_PASSWORD={{ key "secrets/jitsi/jvb_pass" | trimSpace }}
EOF
destination = "secrets/global_env"
env = true
}
template {
data = file("../config/prosody.cfg.lua")
destination = "secrets/prosody.cfg.lua"
}
# --- secrets ---
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.crt\" }}"
destination = "secrets/certs/auth.jitsi.crt"
}
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.key\" }}"
destination = "secrets/certs/auth.jitsi.key"
}
template {
data = "{{ key \"secrets/jitsi/jitsi.crt\" }}"
destination = "secrets/certs/jitsi.crt"
}
template {
data = "{{ key \"secrets/jitsi/jitsi.key\" }}"
destination = "secrets/certs/jitsi.key"
}
resources {
cpu = 300
memory = 200
}
service {
tags = [ "jitsi", "bosh" ]
port = "bosh_port"
address_mode = "host"
name = "bosh-jitsi"
check {
type = "tcp"
port = "bosh_port"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
service {
tags = [ "jitsi", "xmpp" ]
port = "xmpp_port"
address_mode = "host"
name = "xmpp-jitsi"
}
}
task "front" {
driver = "docker"
config {
2024-09-12 17:59:51 +00:00
image = "superboum/amd64_jitsi_meet:v7"
2022-08-23 16:00:07 +00:00
network_mode = "host"
ports = [ "https_port" ]
volumes = [
"secrets/certs/jitsi.crt:/etc/nginx/jitsi.crt",
"secrets/certs/jitsi.key:/etc/nginx/jitsi.key",
"secrets/config.js:/srv/jitsi-meet/config.js",
"secrets/nginx.conf:/etc/nginx/nginx.conf"
]
}
2024-03-09 11:56:29 +00:00
logs {
max_files = 25
max_file_size = 10
}
2022-08-23 16:00:07 +00:00
template {
data = file("../config/config.js")
destination = "secrets/config.js"
}
template {
data = file("../config/nginx.conf")
destination = "secrets/nginx.conf"
}
# --- secrets ---
template {
data = "{{ key \"secrets/jitsi/jitsi.crt\" }}"
destination = "secrets/certs/jitsi.crt"
}
template {
data = "{{ key \"secrets/jitsi/jitsi.key\" }}"
destination = "secrets/certs/jitsi.key"
}
resources {
cpu = 300
memory = 200
}
service {
tags = [
"jitsi",
"tricot jitsi.deuxfleurs.fr",
2023-01-04 08:35:40 +00:00
"d53-cname jitsi.deuxfleurs.fr",
2022-08-23 16:00:07 +00:00
]
port = "https_port"
address_mode = "host"
name = "https-jitsi"
check {
type = "tcp"
port = "https_port"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
}
task "jicofo" {
driver = "docker"
config {
2024-09-12 17:59:51 +00:00
image = "superboum/amd64_jitsi_conference_focus:v11"
2022-08-23 16:00:07 +00:00
network_mode = "host"
volumes = [
"secrets/certs/jitsi.crt:/usr/local/share/ca-certificates/jitsi.crt",
"secrets/certs/auth.jitsi.crt:/usr/local/share/ca-certificates/auth.jitsi.crt",
"secrets/jicofo.conf:/etc/jitsi/jicofo.conf"
]
}
template {
data = file("../config/jicofo.conf")
destination = "secrets/jicofo.conf"
}
#--- secrets ---
template {
data = "{{ key \"secrets/jitsi/jitsi.crt\" }}"
destination = "secrets/certs/jitsi.crt"
}
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.crt\" }}"
destination = "secrets/certs/auth.jitsi.crt"
}
resources {
cpu = 300
memory = 400
}
}
2023-02-02 07:24:45 +00:00
}
group "data_plane" {
network {
port "video_port" { static = 8080 }
2024-09-20 08:39:36 +00:00
port "management_port" { static = 8000 }
2023-02-02 07:24:45 +00:00
}
2022-08-23 16:00:07 +00:00
task "videobridge" {
driver = "docker"
config {
2024-09-12 17:59:51 +00:00
image = "superboum/amd64_jitsi_videobridge:v22"
2022-08-23 16:00:07 +00:00
network_mode = "host"
2024-09-20 08:39:36 +00:00
ports = [ "video_port", "management_port" ]
2022-08-23 16:00:07 +00:00
ulimit {
nofile = "1048576:1048576"
nproc = "65536:65536"
}
volumes = [
"secrets/certs/jitsi.crt:/usr/local/share/ca-certificates/jitsi.crt",
"secrets/certs/auth.jitsi.crt:/usr/local/share/ca-certificates/auth.jitsi.crt",
"secrets/videobridge.conf:/etc/jitsi/videobridge.conf"
]
}
template {
data = <<EOH
{{ with $a := env "attr.unique.hostname" | printf "diplonat/autodiscovery/ipv4/%s" | key | parseJSON }}
JITSI_NAT_PUBLIC_IP = {{ $a.address }}
{{ end }}
EOH
destination = "secrets/jitsi-videobridge.env"
env = true
2022-08-23 16:00:07 +00:00
}
template {
data = file("../config/videobridge.conf")
destination = "secrets/videobridge.conf"
}
# --- secrets ---
template {
data = "{{ key \"secrets/jitsi/jitsi.crt\" }}"
destination = "secrets/certs/jitsi.crt"
}
template {
data = "{{ key \"secrets/jitsi/auth.jitsi.crt\" }}"
destination = "secrets/certs/auth.jitsi.crt"
}
resources {
cpu = 900
2023-02-02 07:24:45 +00:00
memory = 500
memory_max = 3000
2022-08-23 16:00:07 +00:00
}
service {
tags = [ "jitsi", "(diplonat (tcp_port 8080) (udp_port 8080))" ]
port = "video_port"
address_mode = "host"
name = "video-jitsi"
2024-09-20 09:04:49 +00:00
}
service {
tags = [ "jitsi" ]
port = "management_port"
address_mode = "host"
name = "management-video-jitsi"
2022-08-23 16:00:07 +00:00
check {
type = "tcp"
2024-09-20 08:39:36 +00:00
port = "management_port"
2022-08-23 16:00:07 +00:00
interval = "60s"
timeout = "5s"
}
}
}
}
}