From 4225d2236950f99412e2db969d5af96d1fcb8339 Mon Sep 17 00:00:00 2001 From: TwiN Date: Sun, 8 Jan 2023 18:34:13 -0500 Subject: [PATCH] docs: Add example of docker-compose with multiple configuration files --- .../config/backend.yaml | 21 +++++++++++++++++++ .../config/frontend.yaml | 8 +++++++ .../config/global.yaml | 8 +++++++ .../docker-compose.yml | 10 +++++++++ .github/workflows/test.yml | 2 ++ 5 files changed, 49 insertions(+) create mode 100644 .examples/docker-compose-multiple-config-files/config/backend.yaml create mode 100644 .examples/docker-compose-multiple-config-files/config/frontend.yaml create mode 100644 .examples/docker-compose-multiple-config-files/config/global.yaml create mode 100644 .examples/docker-compose-multiple-config-files/docker-compose.yml diff --git a/.examples/docker-compose-multiple-config-files/config/backend.yaml b/.examples/docker-compose-multiple-config-files/config/backend.yaml new file mode 100644 index 00000000..b17d3e1b --- /dev/null +++ b/.examples/docker-compose-multiple-config-files/config/backend.yaml @@ -0,0 +1,21 @@ +endpoints: + - name: check-if-api-is-healthy + group: backend + url: "https://twin.sh/health" + interval: 5m + conditions: + - "[STATUS] == 200" + - "[BODY].status == UP" + - "[RESPONSE_TIME] < 1000" + + - name: check-if-website-is-pingable + url: "icmp://example.org" + interval: 1m + conditions: + - "[CONNECTED] == true" + + - name: check-domain-expiration + url: "https://example.org" + interval: 6h + conditions: + - "[DOMAIN_EXPIRATION] > 720h" diff --git a/.examples/docker-compose-multiple-config-files/config/frontend.yaml b/.examples/docker-compose-multiple-config-files/config/frontend.yaml new file mode 100644 index 00000000..700d1fe8 --- /dev/null +++ b/.examples/docker-compose-multiple-config-files/config/frontend.yaml @@ -0,0 +1,8 @@ +endpoints: + - name: make-sure-html-rendering-works + group: frontend + url: "https://example.org" + interval: 5m + conditions: + - "[STATUS] == 200" + - "[BODY] == pat(*

Example Domain

*)" # Check for header in HTML page diff --git a/.examples/docker-compose-multiple-config-files/config/global.yaml b/.examples/docker-compose-multiple-config-files/config/global.yaml new file mode 100644 index 00000000..44e54fa2 --- /dev/null +++ b/.examples/docker-compose-multiple-config-files/config/global.yaml @@ -0,0 +1,8 @@ +metrics: true +debug: false +ui: + header: Example Company + link: https://example.org + buttons: + - name: "Home" + link: "https://example.org" diff --git a/.examples/docker-compose-multiple-config-files/docker-compose.yml b/.examples/docker-compose-multiple-config-files/docker-compose.yml new file mode 100644 index 00000000..514cd558 --- /dev/null +++ b/.examples/docker-compose-multiple-config-files/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.8" +services: + gatus: + image: twinproduction/gatus:latest + ports: + - "8080:8080" + environment: + - GATUS_CONFIG_PATH=/config + volumes: + - ./config:/config \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29b62a33..e70ba41d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,12 +3,14 @@ on: pull_request: paths-ignore: - '*.md' + - '.examples/*' push: branches: - master paths-ignore: - '*.md' - '.github/*' + - '.examples/*' jobs: test: runs-on: ubuntu-latest