diff --git a/_sys/traefik.hcl b/_sys/traefik.hcl index 0c1e330..4c6b99a 100644 --- a/_sys/traefik.hcl +++ b/_sys/traefik.hcl @@ -18,6 +18,7 @@ job "traefik" { port "api" { static = 81 } + } service { diff --git a/apps/gitea/live.hcl b/apps/gitea/live.hcl index 5b24d0a..3ecfaf2 100644 --- a/apps/gitea/live.hcl +++ b/apps/gitea/live.hcl @@ -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" { diff --git a/apps/postgresql/live.hcl b/apps/postgresql/live.hcl index a56ef6b..08bcdce 100644 --- a/apps/postgresql/live.hcl +++ b/apps/postgresql/live.hcl @@ -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