Files
alo-cluster/services/couchdb.hcl
2023-09-04 06:25:58 +01:00

95 lines
2.1 KiB
HCL

job "couchdb" {
datacenters = ["alo"]
group "db" {
network {
port "api" {
to = 5984
}
}
task "server" {
driver = "docker"
config {
image = "couchdb:3.3"
ports = ["api"]
volumes = [
"/data/compute/appdata/couchdb:/opt/couchdb/data",
"local/couchdb.ini:/opt/couchdb/etc/local.d/local.ini",
"local/vm.args:/opt/couchdb/etc/vm.args",
]
}
service {
name = "couchdb"
port = "api"
tags = [
"traefik.enable=true",
"traefik.http.routers.couchdb.entryPoints=websecure",
"traefik.http.routers.couchdb.rule=Host(`pidb.paler.net`)",
]
}
template {
data = <<EOH
# (Debian) Package-introduced administrative user
[admins]
admin = -pbkdf2-eeb3e20eb9b58edec62d10987d7aed3465c425d4,3cf6e90591d435fbfa9262693490b9c8,10
[couchdb]
uuid = 66ab957b6c21d9fd2ff6bda36da9f4b7
[couch_httpd_auth]
secret = a57bfaa045b960c301411bb0893d88ac
allow_persistent_cookies = true
; 8 weeks
timeout = 4838400
[cors]
origins = https://pi.paler.net,https://noteself.org
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET, PUT, POST, HEAD, DELETE
[httpd]
enable_cors = true
EOH
destination = "local/couchdb.ini"
}
template {
data = <<EOH
-name couchdb@127.0.0.1
# All nodes must share the same magic cookie for distributed Erlang to work.
# Comment out this line if you synchronized the cookies by other means (using
# the ~/.erlang.cookie file, for example).
#-setcookie monster
# Tell kernel and SASL not to log anything
-kernel error_logger silent
-sasl sasl_error_logger false
# Use kernel poll functionality if supported by emulator
+K true
# Start a pool of asynchronous IO threads
+A 16
# Comment this line out to enable the interactive Erlang shell on startup
+Bd -noinput
# Force use of the smp scheduler, fixes #1296
-smp enable
# Set maximum SSL session lifetime to reap terminated replication readers
-ssl session_lifetime 300
EOH
destination = "local/vm.args"
}
}
}
}