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