Repository navigation
Expand file tree
/
Copy pathdocker-compose.dr.yml
More file actions
75 lines (71 loc) · 1.99 KB
/
Copy pathdocker-compose.dr.yml
File metadata and controls
75 lines (71 loc) · 1.99 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
name: outbox-dr
services:
dr:
build:
context: .
dockerfile: ./tests_dr/Dockerfile
user: root
cap_add:
- NET_ADMIN
volumes:
- .:/code
- /code/.venv
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
pg-replica:
condition: service_healthy
pg-standby:
condition: service_healthy
environment:
- PRIMARY_DSN=postgresql://outbox:outbox@pg-primary:5432/outbox
- STANDBY_DSN=postgresql://outbox:outbox@pg-standby:5432/outbox
- REPLICA_DSN=postgresql://outbox:outbox@pg-replica:5432/outbox
pg-primary:
image: postgres:17
container_name: outbox-dr-primary
command: ["postgres", "-c", "wal_keep_size=256MB"]
environment:
- POSTGRES_USER=outbox
- POSTGRES_PASSWORD=outbox
- POSTGRES_DB=outbox
volumes:
- ./tests_dr/primary-init.sh:/docker-entrypoint-initdb.d/primary-init.sh:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U outbox -d outbox"]
interval: 1s
timeout: 3s
retries: 30
pg-replica:
image: postgres:17
container_name: outbox-dr-replica
user: postgres
entrypoint: ["bash", "/replica-entrypoint.sh"]
environment:
- PGPASSWORD=outbox
volumes:
- ./tests_dr/replica-entrypoint.sh:/replica-entrypoint.sh:ro
depends_on:
pg-primary:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U outbox -d outbox"]
interval: 1s
timeout: 3s
retries: 60
pg-standby:
image: postgres:17
container_name: outbox-dr-standby
user: postgres
entrypoint: ["bash", "/replica-entrypoint.sh"]
environment:
- PGPASSWORD=outbox
volumes:
- ./tests_dr/replica-entrypoint.sh:/replica-entrypoint.sh:ro
depends_on:
pg-primary:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U outbox -d outbox"]
interval: 1s
timeout: 3s
retries: 60