aboutsummaryrefslogtreecommitdiff
path: root/nomad/jitsi.hcl
blob: 7f69d80985c6e4d6f6c5d70155ca1843e13fe591 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
 * WIP WIP WIP WIP
 *
 *   + NEED TO INJECT CERTIFICATES
 *   + NEED TO SET ENV VARIABLES
 *   + ADD AT LEAST jitsi-videobridge.jitsi.deuxfleurs.fr TO DNS
 */

job "jitsi" {
  datacenters = ["dc1"]
  type = "service"

  constraint {
    attribute = "${attr.cpu.arch}"
    value     = "amd64"
  }

  group "core" {
    task "xmpp" {
      driver = "docker"
      config {
        image = "superboum/amd64_jitsi_xmpp:v1"
        network_mode = "host"
        port_map {
          xmpp_port = 5222
          ext_port = 5347
          bosh_port = 5280
        }
      }

      resources {
        cpu = 300
        memory = 200
        network {
          port "xmpp_port" {
            static = "5222"
          }
          port "ext_port" {
            static = "5347"
          }
          port "bosh_port" {
            static = "5280"
          }
        }
      }

      service {
        tags = [
          "jitsi"
        ]
        port = "bosh_port"
        address_mode = "host"
        name = "jitsi-xmpp-bosh"
        check {
          type = "tcp"
          port = "bosh_port"
          interval = "60s"
          timeout = "5s"
          check_restart {
            limit = 3
            grace = "90s"
            ignore_warnings = false
          }
        }
      }
    }

    task "front" {
      driver = "docker"
      config {
        image = "superboum/amd64_jitsi_front:v1"
        network_mode = "host"
        port_map {
          https_port = 443
        }
      }

      resources {
        cpu = 300
        memory = 200
        network {
          port "https_port" {
            static = "443"
          }
        }
      } 

     service {
        tags = [
          "jitsi",
          "traefik.enable=true",
          "traefik.frontend.entryPoints=https,http",
          "traefik.frontend.rule=Host:jitsi.deuxfleurs.fr;PathPrefix:/"
        ]
        port = "https_port"
        address_mode = "host"
        name = "jitsi-front-https"
        check {
          type = "tcp"
          port = "https_port"
          interval = "60s"
          timeout = "5s"
          check_restart {
            limit = 3
            grace = "90s"
            ignore_warnings = false
          }
        }
      }
    }

    task "jicofo" {
      driver = "docker"
      config {
        image = "superboum/amd64_jitsi_conference_focus:v1"
        network_mode = "host"
      }

      resources {
        cpu = 300
        memory = 200
      } 
    }

    task "videobridge" {
      driver = "docker"
      config {
        image = "superboum/amd64_jitsi_videobridge:v1"
        network_mode = "host"
        port_map {
          video1_port = 4443
          video2_port = 10000
        }
      }

      resources {
        cpu = 300
        memory = 500
        network {
          port "video1_port" {
            static = "4443"
          }
          port "video2_port" {
            static = "10000"
          }
        }

      } 

      service {
        tags = [
          "jitsi"
        ]
        port = "video1_port"
        address_mode = "host"
        name = "jitsi-videobridge-video1"
        check {
          type = "tcp"
          port = "video1_port"
          interval = "60s"
          timeout = "5s"
          check_restart {
            limit = 3
            grace = "90s"
            ignore_warnings = false
          }
        }
      }
    }

  }
}