forked from MattMacGillivray/streaming-replication-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-replication.yaml
45 lines (42 loc) · 1.4 KB
/
docker-compose-replication.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
version: "3.7"
services:
timescale-primary:
image: "timescale/timescaledb:latest-pg12"
container_name: "timescale-primary"
environment:
- "POSTGRES_USER=postgres"
- "POSTGRES_PASSWORD=postgres"
- "PGDATA=/var/lib/postgresql/data"
- "REPLICA_POSTGRES_USER=repuser"
- "REPLICA_POSTGRES_PASSWORD=repuser"
- "REPLICATE_TO=timescale-replica"
- "REPLICA_NAME=r1"
- "SYNCHRONOUS_COMMIT=off"
environment:
REPLICATION_SUBNET: "10.0.0.0/24"
ports:
- "5432:5432"
volumes:
- "./replication.sh:/docker-entrypoint-initdb.d/replication.sh"
- "./data/primary:/var/lib/postgresql/data"
networks:
- "timescale-net"
timescale-replica:
image: "timescale/timescaledb:latest-pg12"
container_name: "timescale-replica"
environment:
- "POSTGRES_USER=repuser"
- "POSTGRES_PASSWORD=repuser"
- "PGDATA=/var/lib/postgresql/data"
- "REPLICA_NAME=r1"
- "REPLICATE_FROM=timescale-primary"
ports:
- "5433:5432"
volumes:
- "./data/replica:/var/lib/postgresql/data"
networks:
- "timescale-net"
networks:
timescale-net:
external: false
name: "timescale-net"