-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompose.yaml
More file actions
111 lines (107 loc) · 2.88 KB
/
compose.yaml
File metadata and controls
111 lines (107 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
services:
postgres:
image: postgres:18-alpine
container_name: torii-postgres
command:
- postgres
- -c
- shared_buffers=${PG_SHARED_BUFFERS:-8GB}
- -c
- effective_cache_size=${PG_EFFECTIVE_CACHE_SIZE:-24GB}
- -c
- maintenance_work_mem=${PG_MAINTENANCE_WORK_MEM:-2GB}
- -c
- work_mem=${PG_WORK_MEM:-64MB}
- -c
- max_connections=${PG_MAX_CONNECTIONS:-100}
- -c
- wal_buffers=16MB
- -c
- min_wal_size=2GB
- -c
- max_wal_size=8GB
- -c
- checkpoint_timeout=30min
- -c
- checkpoint_completion_target=0.9
- -c
- wal_compression=on
- -c
- synchronous_commit=off
- -c
- random_page_cost=1.1
- -c
- effective_io_concurrency=200
- -c
- default_statistics_target=100
- -c
- autovacuum_naptime=10s
- -c
- autovacuum_vacuum_scale_factor=0.02
- -c
- autovacuum_analyze_scale_factor=0.01
- -c
- max_worker_processes=16
- -c
- max_parallel_workers=8
- -c
- max_parallel_workers_per_gather=4
- -c
- max_parallel_maintenance_workers=4
environment:
POSTGRES_USER: torii
POSTGRES_PASSWORD: torii
POSTGRES_DB: torii
PGDATA: /var/lib/postgresql/18/docker/data
ports:
- "5432:5432"
shm_size: ${PG_SHM_SIZE:-8g}
volumes:
- ${PGDATA_DIR:-./data/torii-postgres}:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U torii -d torii"]
interval: 5s
timeout: 5s
retries: 10
postgres-exporter:
image: prometheuscommunity/postgres-exporter:v0.18.1
container_name: torii-postgres-exporter
environment:
DATA_SOURCE_NAME: postgresql://torii:torii@postgres:5432/torii?sslmode=disable
ports:
- "9187:9187"
depends_on:
postgres:
condition: service_healthy
prometheus:
image: prom/prometheus:v2.55.1
container_name: torii-prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
ports:
- "9090:9090"
volumes:
- ./observability/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
depends_on:
- postgres-exporter
grafana:
image: grafana/grafana:11.2.2
container_name: torii-grafana
ports:
- "3002:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro
- ./observability/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
depends_on:
- prometheus
volumes:
prometheus-data:
grafana-data: