Skip to content

Commit db255ff

Browse files
committed
Add docker-compose yaml file
1 parent d4af942 commit db255ff

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
/.metrics.*.removed
2121
/tools/src
2222
/vendor
23+
.env

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3.5"
2+
3+
services:
4+
postgres_exporter:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
image: quay.io/prometheuscommunity/postgres-exporter
9+
network_mode: host
10+
environment:
11+
DATA_SOURCE_NAME: "postgresql://${PG_USERNAME:-postgres}:${PG_PASSWORD:-password}@${PG_HOST:-localhost}:${PG_PORT:-5432}/${DB_NAME:-postgres}?sslmode=disable"
12+
PG_EXPORTER_WEB_LISTEN_ADDRESS: ":9187"

env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The database for which the Prometheus metrics must be exported
2+
PG_USERNAME=postgres
3+
PG_PASSWORD=password
4+
PG_HOST=localhost
5+
PG_PORT=5432
6+
DB_NAME=postgres

0 commit comments

Comments
 (0)