Initial config.

This commit is contained in:
2025-04-11 22:26:27 +01:00
parent ad5cf2d44e
commit 13c222f783
2 changed files with 74 additions and 0 deletions

74
services/petruwiki.hcl Normal file
View File

@@ -0,0 +1,74 @@
job "petruwiki" {
datacenters = ["alo"]
group "server" {
volume "appdata" {
type = "host"
read_only = false
source = "appdata"
}
volume "nix-store" {
type = "host"
read_only = true
source = "nix-store"
}
volume "sw" {
type = "host"
read_only = true
source = "sw"
}
network {
port "http" { }
}
task "wiki" {
driver = "exec"
config {
command = "/sw/bin/node"
args = [
"/appdata/petruwiki/node_modules/tiddlywiki/tiddlywiki.js",
"/appdata/petruwiki/petruwiki",
"--listen",
"host=0.0.0.0",
"port=${NOMAD_PORT_http}",
"authenticated-user-header=X-authentik-username",
"readers=ppetru",
"writers=ppetru",
"admin=ppetru",
]
}
user = "ppetru"
volume_mount {
volume = "appdata"
destination = "/appdata"
}
volume_mount {
volume = "nix-store"
destination = "/nix/store"
}
volume_mount {
volume = "sw"
destination = "/sw"
}
service {
name = "petruwiki"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.petruwiki.entryPoints=websecure",
"traefik.http.routers.petruwiki.middlewares=authentik@file",
]
}
resources {
cpu = 1000
memory = 512
}
}
}
}