-
Notifications
You must be signed in to change notification settings - Fork 31
/
docker-compose.database.yaml
57 lines (53 loc) · 1.25 KB
/
docker-compose.database.yaml
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
version: '3.9'
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER:
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
POSTGRES_DBNAME:
ports:
- target: 5432
published: ${POSTGRES_PUBLISH_PORT:-5432}
mode: host
secrets:
- postgres_password
command: postgres -c max_connections=2048 -c shared_buffers=32GB -c work_mem=8GB -c max_wal_size=16GB
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
shm_size: 16G
tmpfs:
- /shm_tmp:size=16G
volumes:
- postgres_data:/var/lib/postgresql/data
- type: tmpfs
target: /dev/shm
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
placement:
constraints:
- "node.labels.${TONCENTER_ENV:?}.indexer-cpp.storage==true"
networks:
internal:
logging:
driver: local
options:
max-size: 4G
volumes:
postgres_data:
external: false
networks:
internal:
attachable: true
external: false
driver_opts:
com.docker.network.driver.mtu: 1350
secrets:
postgres_password:
file: ${POSTGRES_PASSWORD_FILE:-private/postgres_password}