2021-02-18 20:59:11 +01:00
|
|
|
job "gitea" {
|
|
|
|
datacenters = [ "homelab-1" ]
|
|
|
|
type = "service"
|
|
|
|
|
2021-05-12 12:23:14 +02:00
|
|
|
constraint {
|
|
|
|
attribute = "${attr.unique.hostname}"
|
|
|
|
value = "blowhole"
|
|
|
|
}
|
|
|
|
|
2021-02-18 20:59:11 +01:00
|
|
|
group "svc" {
|
|
|
|
count = 1
|
|
|
|
|
|
|
|
volume "gitea-data" {
|
|
|
|
type = "csi"
|
|
|
|
source = "gitea-data"
|
|
|
|
read_only = false
|
2021-06-23 11:41:06 +02:00
|
|
|
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
access_mode = "single-node-writer"
|
2021-02-18 20:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
volume "gitea-db" {
|
|
|
|
type = "csi"
|
|
|
|
source = "gitea-db"
|
|
|
|
read_only = false
|
2021-06-23 11:41:06 +02:00
|
|
|
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
access_mode = "single-node-writer"
|
2021-02-18 20:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
restart {
|
|
|
|
attempts = 5
|
|
|
|
delay = "5s"
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
2021-06-23 11:41:06 +02:00
|
|
|
mode = "bridge"
|
2021-02-18 20:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "gitea"
|
2021-06-23 11:41:06 +02:00
|
|
|
port = "3000"
|
2021-02-18 20:59:11 +01:00
|
|
|
|
|
|
|
check {
|
|
|
|
type = "http"
|
2021-06-23 11:41:06 +02:00
|
|
|
address_mode = "alloc"
|
2021-02-18 20:59:11 +01:00
|
|
|
path = "/"
|
2021-06-23 11:41:06 +02:00
|
|
|
port = "3000"
|
2021-02-18 20:59:11 +01:00
|
|
|
interval = "2s"
|
|
|
|
timeout = "2s"
|
|
|
|
}
|
2021-06-23 11:41:06 +02:00
|
|
|
|
|
|
|
connect {
|
|
|
|
sidecar_service {}
|
|
|
|
}
|
2021-02-18 20:59:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
task "app" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
volume_mount {
|
|
|
|
volume = "gitea-data"
|
|
|
|
destination = "/data/gitea"
|
|
|
|
read_only = false
|
|
|
|
}
|
|
|
|
|
|
|
|
config {
|
2021-05-02 15:51:38 +02:00
|
|
|
image = "magicrb/gitea:yc5q5q4q4zmih2rr1xjamnzxx7agjz55"
|
2021-02-18 20:59:11 +01:00
|
|
|
|
|
|
|
volumes = [
|
|
|
|
"local/app.ini:/app.ini",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
env {
|
|
|
|
USER_UID = "5001"
|
|
|
|
USER_GID = "5001"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 500
|
|
|
|
memory = 1024
|
|
|
|
}
|
|
|
|
|
|
|
|
vault {
|
|
|
|
policies = ["gitea-policy"]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = file("./app.ini.tpl")
|
|
|
|
destination = "local/app.ini"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "db" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
volume_mount {
|
|
|
|
volume = "gitea-db"
|
|
|
|
destination = "/data/mariadb"
|
|
|
|
read_only = false
|
|
|
|
}
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "mariadb:local"
|
|
|
|
}
|
|
|
|
|
|
|
|
env {
|
|
|
|
USER_UID = "84"
|
|
|
|
USER_GID = "84"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 500
|
|
|
|
memory = 512
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|