Untitled

 avatar
unknown
plain_text
2 months ago
1.8 kB
5
No Index
mollysocket.hcl 


job "mollysocket" {
  datacenters = ["hetzner"]
  type        = "service"
  group "home" {
    count = 1

    network {
      port "http" {
        to           = 8020 # container port the app runs on
        host_network = "tailscale"
      }
    }

    task "mollysocket" {
      driver = "docker"

      logs {
        disabled = true
      }

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

      env {
        MOLLY_CONF = "/etc/mollysocket.conf"
        RUST_LOG = "info"
      }

      config {
        image = "ghcr.io/mollyim/mollysocket:latest"
        command = "server"

        mounts = [
          {
            type     = "bind"
            target   = "/etc/mollysocket.conf"
            source   = "/data/volumes/mollysocket/etc/mollysocket.conf"
            readonly = true
            bind_options = {
              propagation = "rshared"
            }
          },
          {
            type     = "bind"
            target   = "/db"
            source   = "/data/volumes/mollysocket/db"
            readonly = false
            bind_options = {
              propagation = "rshared"
            }
          }
        ]

        ports = [
          "http"
        ]
      }

      resources {
        cpu    = 100
        memory = 100
      }

      service {
        name     = "mollysocket"
        provider = "consul"
        port     = "http"

        tags = ["tricot molly.domain.tld"]

      }
    }
  }
}


mollysocket.conf

db = "/db/mollysocket.db"
# Do not add space in the array ["http://a.tld","*"]
allowed_endpoints = ["https://up.conversations.im"]
allowed_uuids = ["UUID"]
# TODO:
#- MOLLY_VAPID_PRIVKEY="paste output of `docker compose exec mollysocket mollysocket vapid gen` here"
host = "0.0.0.0"
port = "8020"
vapid_privkey = "TOKEN"
Editor is loading...
Leave a Comment