diff --git a/docs/deploying/_meta.json b/docs/deploying/_meta.json index 0dad4ce26..6aaff1792 100644 --- a/docs/deploying/_meta.json +++ b/docs/deploying/_meta.json @@ -34,6 +34,11 @@ "name": "kubernetes", "label": "Kubernetes" }, + { + "type": "file", + "name": "nomad", + "label": "Nomad" + }, { "type": "file", "name": "freebsd", diff --git a/docs/deploying/nomad.mdx b/docs/deploying/nomad.mdx new file mode 100644 index 000000000..8b9cc6735 --- /dev/null +++ b/docs/deploying/nomad.mdx @@ -0,0 +1,138 @@ +# Continuwuity for Nomad + +You can either pass the configuration as environment variables or mount a file containing the configuration from consul. +This given configuration assumes that you have a traefik reverse proxy running and that you use Cloudflare reverse proxy. + +## Persistence +The database being a RockDB file, it is recommended to use a volume to persist the data. +The example below uses a volume, you need to configure the CSI driver on your cluster. +## Configuration +### Using environment variables +```hcl +job "continuwuity" { + datacenters = ["dc1"] + type = "service" + node_pool = "default" + + group "continuwuity" { + count = 1 + + network { + port "http" { + static = 6167 + } + } + + service { + name = "continuwuity" + port = "http" + tags = [ + "traefik.enable=true", + "traefik.http.routers.continuwuity.rule=(Host(`matrix.example.com`) || (Host(`example.com`) && PathPrefix(`/.well-known/matrix`)))", + "traefik.http.routers.continuwuity.entrypoints=http", + ] + } + + volume "continuwuity-db-volume" { + type = "csi" + read_only = false + source = "continuwuity-db-vol" + attachment_mode = "file-system" + access_mode = "single-node-writer" + per_alloc = false + } + + task "continuwuity" { + driver = "docker" + + env { + CONTINUWUITY_SERVER_NAME = "matrix.example.com" + CONTINUWUITY_TRUSTED_SERVERS = "[\"matrix.org\", \"mozilla.org\"]" + CONTINUWUITY_ALLOW_REGISTRATION = false + CONTINUWUITY_ADDRESS = "0.0.0.0" + CONTINUWUITY_PORT = 6167 + CONTINUWUITY_DATABASE_PATH = "/var/lib/continuwuity" + CONTINUWUITY_WELL_KNOWN = <