Add example for using Postgres

This commit is contained in:
TwinProduction 2021-09-10 19:21:43 -04:00
parent 20487790ca
commit dafd547656
3 changed files with 70 additions and 0 deletions

View File

@ -249,6 +249,7 @@ storage:
type: postgres
file: "postgres://user:password@127.0.0.1:5432/gatus?sslmode=disable"
```
See [examples/docker-compose-postgres-storage](examples/docker-compose-postgres-storage) for an example.
### Client configuration

View File

@ -0,0 +1,42 @@
storage:
type: postgres
file: "postgres://username:password@postgres:5432/gatus?sslmode=disable"
services:
- name: back-end
group: core
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- "[CERTIFICATE_EXPIRATION] > 48h"
- name: monitoring
group: internal
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- name: nas
group: internal
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- name: example-dns-query
url: "8.8.8.8" # Address of the DNS server to use
interval: 5m
dns:
query-name: "example.com"
query-type: "A"
conditions:
- "[BODY] == 93.184.216.34"
- "[DNS_RCODE] == NOERROR"
- name: icmp-ping
url: "icmp://example.org"
interval: 1m
conditions:
- "[CONNECTED] == true"

View File

@ -0,0 +1,27 @@
version: "3.9"
services:
postgres:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=gatus
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
networks:
- web
gatus:
image: twinproduction/gatus:latest
restart: always
ports:
- 8080:8080
volumes:
- ./config.yaml:/config/config.yaml
networks:
- web
depends_on:
- postgres
networks:
web: