Skip to content

Commit 8fe2d01

Browse files
committed
Initial commit
0 parents  commit 8fe2d01

20 files changed

+2142
-0
lines changed

.~lock.pgday2.odp#

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
,jacroute,toadette.wrk.cby.camptocamp.com,09.06.2022 12:18,file:///home/jacroute/.config/libreoffice/4;

docker-compose.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
version: "2.2"
2+
services:
3+
4+
postgres:
5+
image: postgres:14
6+
command: -c 'shared_preload_libraries=pg_stat_statements'
7+
environment:
8+
POSTGRES_PASSWORD: pgpass
9+
ports:
10+
- "5432:5432"
11+
volumes:
12+
- pgdata-primary:/var/lib/postgresql/data
13+
- ./initdb-primary.d:/docker-entrypoint-initdb.d
14+
15+
replica:
16+
image: postgres:14
17+
command: -c 'shared_preload_libraries=pg_stat_statements'
18+
environment:
19+
POSTGRES_PASSWORD: pgpass-replica
20+
PGUSER: postgres
21+
PGPASSWORD: pgpass
22+
PGHOST: postgres
23+
ports:
24+
- "5433:5432"
25+
volumes:
26+
- pgdata-replica:/var/lib/postgresql/data
27+
- ./initdb-replica.d:/docker-entrypoint-initdb.d
28+
29+
traffic:
30+
image: postgres:14
31+
entrypoint: ""
32+
command: /usr/local/bin/traffic.sh
33+
stop_signal: KILL
34+
environment:
35+
PGUSER: postgres
36+
PGPASSWORD: pgpass
37+
PGHOST: postgres
38+
volumes:
39+
- ./traffic.sh:/usr/local/bin/traffic.sh
40+
41+
exporter-primary:
42+
image: prometheuscommunity/postgres-exporter:v0.10.1
43+
environment:
44+
DATA_SOURCE_NAME: postgresql://postgres:pgpass@postgres:5432/postgres?sslmode=disable
45+
PG_EXPORTER_EXTEND_QUERY_PATH: /mnt/queries.yaml
46+
ports:
47+
- "9187:9187"
48+
#volumes:
49+
#- ./queries.yaml:/mnt/queries.yaml
50+
51+
exporter-replica:
52+
image: prometheuscommunity/postgres-exporter:v0.10.1
53+
environment:
54+
DATA_SOURCE_NAME: postgresql://postgres:pgpass@replica:5432/postgres?sslmode=disable
55+
PG_EXPORTER_EXTEND_QUERY_PATH: /mnt/queries.yaml
56+
ports:
57+
- "9188:9187"
58+
volumes:
59+
- ./queries.yaml:/mnt/queries.yaml
60+
61+
# Observability
62+
prometheus:
63+
image: prom/prometheus
64+
cpu_count: 1
65+
volumes:
66+
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
67+
- prometheus:/prometheus
68+
ports:
69+
- "9090:9090"
70+
71+
grafana:
72+
image: grafana/grafana:8.5.6
73+
volumes:
74+
- grafana-data:/var/lib/grafana
75+
- ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
76+
- ./grafana/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
77+
- ./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json
78+
ports:
79+
- "3000:3000"
80+
81+
volumes:
82+
pgdata-primary:
83+
pgdata-replica:
84+
prometheus:
85+
grafana-data:

0 commit comments

Comments
 (0)