34 lines
766 B
YAML
34 lines
766 B
YAML
|
version: 3
|
||
|
|
||
|
services:
|
||
|
db:
|
||
|
restart: always
|
||
|
image: postgres:14.7-alpine
|
||
|
command: ['-c', 'wal_level=replica', '-c', 'synchronous_standby_names=barman_receive_wal']
|
||
|
shm_size: 256mb
|
||
|
networks:
|
||
|
- internal_network
|
||
|
healthcheck:
|
||
|
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||
|
volumes:
|
||
|
- ./pg-data:/var/lib/postgresql/data:z
|
||
|
- ./initdb:/docker-entrypoint-initdb.d:z
|
||
|
environment:
|
||
|
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
||
|
mem_limit: 2G
|
||
|
memswap_limit: 2G
|
||
|
|
||
|
db-backup:
|
||
|
build: ..
|
||
|
networks:
|
||
|
- internal_network
|
||
|
configs:
|
||
|
- barman_d_db_conf
|
||
|
volumes:
|
||
|
- ./barman-data:/var/lib/barman:z
|
||
|
- ./barman.d:/etc/barman.d:z
|
||
|
|
||
|
networks:
|
||
|
external_network:
|
||
|
internal_network:
|
||
|
internal: true
|