diff --git a/.examples/docker-compose-postgres-storage/config/config.yaml b/.examples/docker-compose-postgres-storage/config/config.yaml index de783853..ea579ecf 100644 --- a/.examples/docker-compose-postgres-storage/config/config.yaml +++ b/.examples/docker-compose-postgres-storage/config/config.yaml @@ -1,6 +1,6 @@ storage: type: postgres - path: "postgres://username:password@postgres:5432/gatus?sslmode=disable" + path: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable" endpoints: - name: back-end diff --git a/.examples/docker-compose-postgres-storage/docker-compose.yml b/.examples/docker-compose-postgres-storage/docker-compose.yml index a610ca2b..a1d76cbc 100644 --- a/.examples/docker-compose-postgres-storage/docker-compose.yml +++ b/.examples/docker-compose-postgres-storage/docker-compose.yml @@ -18,6 +18,10 @@ services: restart: always ports: - "8080:8080" + environment: + - POSTGRES_USER=username + - POSTGRES_PASSWORD=password + - POSTGRES_DB=gatus volumes: - ./config:/config networks: diff --git a/README.md b/README.md index 8022d9b6..57a97dc8 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,8 @@ subdirectories are merged like so: - To clarify, this also means that you could not define `alerting.slack.webhook-url` in two files with different values. All files are merged into one before they are processed. This is by design. > 💡 You can also use environment variables in the configuration file (e.g. `$DOMAIN`, `${DOMAIN}`) +> +> See [examples/docker-compose-postgres-storage/config/config.yaml](.examples/docker-compose-postgres-storage/config/config.yaml) for an example. If you want to test it locally, see [Docker](#docker).