-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.replica.yml
60 lines (58 loc) · 1.46 KB
/
docker-compose.replica.yml
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
version: "3"
services:
postgresql-master:
image: docker.io/bitnami/postgresql:14
volumes:
- 'postgresql_master_data:/bitnami/postgresql'
container_name: mochi-postgres
environment:
- POSTGRESQL_REPLICATION_MODE=master
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_USERNAME=postgres
- POSTGRESQL_PASSWORD=postgres
- POSTGRESQL_DATABASE=mochi_local
- ALLOW_EMPTY_PASSWORD=yes
ports:
- 5434:5432
expose:
- 5434
postgresql-slave:
image: docker.io/bitnami/postgresql:14
depends_on:
- postgresql-master
environment:
- POSTGRESQL_REPLICATION_MODE=slave
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_MASTER_HOST=postgresql-master
- POSTGRESQL_PASSWORD=postgres
- POSTGRESQL_MASTER_PORT_NUMBER=5432
- ALLOW_EMPTY_PASSWORD=yes
ports:
- 5435:5432
expose:
- 5435
redis:
image: redis:6.2.6-alpine
restart: always
container_name: mochi-redis
ports:
- 6379:6379
expose:
- 6379
postgres_test:
image: postgres:13
restart: always
environment:
POSTGRES_DB: mochi_local_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
container_name: mochi_local_test
ports:
- 25433:5432
expose:
- 25433
volumes:
postgresql_master_data:
driver: local