aboutsummaryrefslogtreecommitdiff
path: root/experimental/app/ssb/deploy/go-ssb-room.hcl
blob: c9c4109c8bfa57a48d7e0c7aa18c50c173e4576c (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
job "ssb" {
  datacenters = ["neptune"]
  type = "service"

  group "go-ssb-room" {
    count = 1

    constraint {
      attribute = "${attr.unique.hostname}"
      value     = "caribou"
    }

    network {
      port "web_port" { to = 3888 }
      port "ssb_port" { to = 8008 }
    }

    task "go-ssb-room" {
      driver = "docker"
      config {
        image = "lxpz/amd64_go_ssb_room:1"
        readonly_rootfs = true
        ports = [ "web_port", "ssb_port" ]
        network_mode = "host"
        command = "/app/cmd/server/server"
        args = [ 
          "-https-domain=ssb.staging.deuxfleurs.org",
          "-repo=/repo",
          "-aliases-as-subdomains=false",
          "-lishttp=:3888",
        ]
        volumes = [
          "/mnt/ssd/go-ssb-room:/repo"
        ]
      }

      resources {
        memory = 200
      }

      service {
        name = "go-ssb-room-http"
        tags = [
          "tricot ssb.staging.deuxfleurs.org",
        ]
        port = "web_port"
        address_mode = "driver"
        check {
          type = "tcp"
          port = "web_port"
          interval = "60s"
          timeout = "5s"
          check_restart {
            limit = 3
            grace = "90s"
            ignore_warnings = false
          }
        }
      }

      service {
        name = "go-ssb-room-ssb"
        tags = [
          "(diplonat (port 8008))",
        ]
        port = "ssb_port"
        address_mode = "driver"
        check {
          type = "tcp"
          port = "ssb_port"
          interval = "60s"
          timeout = "5s"
          check_restart {
            limit = 3
            grace = "90s"
            ignore_warnings = false
          }
        }
      }
    }
  }
}