-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
75 lines (75 loc) · 1.92 KB
/
docker-compose.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "3.8"
services:
pg15-repl-source:
image: postgres:${PGVERSION}-alpine
container_name: ${CONTAINER_NAME_PREFIX}-source
command:
[
"postgres",
"-c",
"config_file=/etc/postgresql/postgres.conf"
]
environment:
PGDATA: ${PGDATA_BASEDIR}/source
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- source:${PGDATA_BASEDIR}/source
- ${PWD}/postgres.conf:/etc/postgresql/postgres.conf
- ${PWD}/pg_hba.conf:/etc/postgresql/pg_hba.conf
- ${PWD}/sql:/opt/sql
- ${PWD}/bench:/opt/bench
networks:
- pg15-repl
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"
]
interval: 10s
timeout: 5s
retries: 5
pg15-repl-target:
image: postgres:${PGVERSION}-alpine
container_name: ${CONTAINER_NAME_PREFIX}-target
command:
[
"postgres",
"-c",
"config_file=/etc/postgresql/postgres.conf"
]
environment:
PGDATA: ${PGDATA_BASEDIR}/source
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- target:${PGDATA_BASEDIR}/target
- ${PWD}/postgres.conf:/etc/postgresql/postgres.conf
- ${PWD}/pg_hba.conf:/etc/postgresql/pg_hba.conf
- ${PWD}/sql:/opt/sql
- ${PWD}/bench:/opt/bench
networks:
- pg15-repl
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"
]
interval: 10s
timeout: 5s
retries: 5
volumes:
source:
name: ${CONTAINER_NAME_PREFIX}-source
target:
name: ${CONTAINER_NAME_PREFIX}-target
networks:
pg15-repl:
name: ${CONTAINER_NAME_PREFIX}
driver: bridge