This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nomad.hcl
81 lines (69 loc) · 2.24 KB
/
nomad.hcl
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
job "bookshelf" {
datacenters = ["home1"]
type = "service"
group "bookshelf" {
count = 1
network {
port "http" {}
}
task "bookshelf" {
driver = "docker"
config {
image = "ghcr.io/chriskuchin/bookshelf-rs:main"
ports = ["http"]
force_pull = true
logging {
type = "loki"
config {
loki-external-labels = "service=bookshelf"
}
}
entrypoint = []
volumes = [
"/etc/localtime:/etc/localtime:ro",
"/var/lib/bookshelf:/data"
]
}
vault {
policies = ["cloudflare-r2"]
change_mode = "restart"
}
template {
data = <<-EOH
{{with secret "kv/cloudflare/r2/bookshelf" }}
BOOKSHELF_DB_URL=sqlite:///data/bookshelf.db
BOOKSHELF_STORAGE_URL={{.Data.data.bucket}}
BOOKSHELF_AWS_ACCESS_KEY_ID={{.Data.data.access_key}}
BOOKSHELF_AWS_SECRET_ACCESS_KEY={{.Data.data.secret_key}}
BOOKSHELF_AWS_S3_REGION=auto
BOOKSHELF_AWS_S3_ENDPOINT_URL={{.Data.data.endpoint}}
{{end}}
BOOKSHELF_PORT={{ env "NOMAD_PORT_http" }}
EOH
destination = "secrets/r2.env"
env = true
}
service {
name = "bookshelf"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.bookshelf_http.entrypoints=http",
"traefik.http.routers.bookshelf_http.rule=Host(`bookshelf.home.cksuperman.com`)",
"traefik.http.routers.bookshelf_http.middlewares=bookshelf-redirect@consulcatalog",
"traefik.http.middlewares.bookshelf-redirect.redirectscheme.scheme=https",
"traefik.http.middlewares.bookshelf-redirect.redirectscheme.permanent=true",
"traefik.http.routers.bookshelf.entrypoints=https",
"traefik.http.routers.bookshelf.rule=Host(`bookshelf.home.cksuperman.com`)",
"traefik.http.routers.bookshelf.tls.certresolver=cloudflare",
"traefik.http.routers.bookshelf.tls.domains[0].main=bookshelf.home.cksuperman.com",
"wayfinder.domain=bookshelf.home.cksuperman.com",
]
}
resources {
cpu = 100
memory = 256
}
}
}
}