-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathdocker-compose.yml
52 lines (48 loc) · 1.05 KB
/
docker-compose.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
version: '3'
# twc stands for twitter clone
services:
database:
image: postgres:latest
container_name: twc-postgres_database
command:
- "postgres"
- "-c"
- "wal_level=logical"
restart: always
volumes:
- postgres-data-master:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=twitter
networks:
- database-network
database-slave:
image: postgres:latest
container_name: twc-postgres_database-slave
command:
- "postgres"
- "-c"
- "port=5433"
- "-c"
- "wal_level=logical"
restart: always
volumes:
- postgres-data-slave:/var/lib/postgresql/data
ports:
- 5433:5433
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=twitter_slave
depends_on:
- database
networks:
- database-network
networks:
database-network:
driver: bridge
volumes:
postgres-data-master:
postgres-data-slave: