postgres refactoring and gitea health check
This commit is contained in:
@@ -18,6 +18,7 @@ job "traefik" {
|
||||
port "api" {
|
||||
static = 81
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
service {
|
||||
|
||||
@@ -27,6 +27,13 @@ job "gitea" {
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.gitea.rule=Host(`gitea.service.nr5`)",
|
||||
]
|
||||
|
||||
check {
|
||||
type = "http"
|
||||
path = "/user/login"
|
||||
interval = "120s"
|
||||
timeout = "5s"
|
||||
}
|
||||
}
|
||||
|
||||
volume "gitea-data" {
|
||||
|
||||
@@ -16,14 +16,28 @@ job "postgres" {
|
||||
access_mode = "single-node-writer"
|
||||
attachment_mode = "file-system"
|
||||
}
|
||||
|
||||
network {
|
||||
mode = "host"
|
||||
port "postgres"{
|
||||
static = 5432
|
||||
}
|
||||
}
|
||||
service {
|
||||
name = "postgres"
|
||||
port = "postgres"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.tcp.routers.postgres.rule=HostSNI('postgres.service.nr5')",
|
||||
]
|
||||
|
||||
}
|
||||
task "postgres" {
|
||||
driver = "podman"
|
||||
config {
|
||||
image = "docker.io/postgres:13"
|
||||
network_mode = "host"
|
||||
port_map {
|
||||
db = 5432
|
||||
}
|
||||
ports = ["postgres"]
|
||||
}
|
||||
volume_mount {
|
||||
volume = "postgres-data"
|
||||
@@ -42,24 +56,9 @@ job "postgres" {
|
||||
resources {
|
||||
cpu = 1000
|
||||
memory = 1024
|
||||
network {
|
||||
port "db" {
|
||||
static = 5432
|
||||
}
|
||||
}
|
||||
}
|
||||
service {
|
||||
name = "postgres"
|
||||
tags = ["postgres for vault"]
|
||||
port = "db"
|
||||
|
||||
check {
|
||||
name = "alive"
|
||||
type = "tcp"
|
||||
interval = "60s"
|
||||
timeout = "2s"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
restart {
|
||||
attempts = 10
|
||||
|
||||
Reference in New Issue
Block a user