Database fix
All checks were successful
Deploy Dolibarr / deploy (push) Successful in 3m38s

This commit is contained in:
Henrik Jess Nielsen
2026-05-18 23:58:40 +02:00
parent f841332eeb
commit d10f0d47b2
4 changed files with 109 additions and 69 deletions

79
portaldb.nomad Normal file
View File

@@ -0,0 +1,79 @@
job "portaldb" {
datacenters = ["dc1"]
type = "service"
group "db" {
count = 1
constraint {
attribute = "${node.unique.name}"
value = "autobox.i80.dk"
}
network {
port "mysql" {
static = 3306
}
}
volume "dolibarr-db" {
type = "host"
source = "dolibarr-db"
read_only = false
}
task "mariadb" {
driver = "docker"
config {
image = "mariadb:10.11"
ports = ["mysql"]
}
volume_mount {
volume = "dolibarr-db"
destination = "/var/lib/mysql"
}
template {
data = <<EOH
MARIADB_ROOT_PASSWORD="{{ key "dolibarr/db_root_password" }}"
MARIADB_DATABASE="dolibarr"
MARIADB_USER="dolibarr"
MARIADB_PASSWORD="{{ key "dolibarr/db_password" }}"
EOH
destination = "secrets/mariadb.env"
env = true
}
resources {
cpu = 256
memory = 512
}
restart {
attempts = 5
delay = "15s"
interval = "2m"
mode = "fail"
}
service {
name = "portaldb"
port = "mysql"
provider = "consul"
tags = [
"traefik.enable=true",
"traefik.http.routers.portaldb.rule=Host(`portaldb.i80.dk`)",
]
check {
type = "tcp"
interval = "10s"
timeout = "3s"
}
}
}
}
}