-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (44 loc) · 934 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
47 lines (44 loc) · 934 Bytes
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
# PostgreSQL with High Availability in Docker
# https://hub.docker.com/_/postgres
#
version: '3.1'
services:
db.master:
image: db.master
networks:
- net_postgres
volumes:
- vol_postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=devops
- POSTGRES_PASSWORD=devops
- POSTGRES_DB=postgres
- PG_MASTER_REP_USER=devops_rep
- PG_MASTER_REP_PASS=devops_rep
restart: always
build:
context: ./db/
args:
- mode=master
db.standby:
image: db.standby
networks:
- net_postgres
volumes:
- vol_postgres:/var/lib/postgresql/data
environment:
- PG_MASTER_HOST=db.master
- PG_MASTER_PORT=5432
- PG_MASTER_REP_USER=devops_rep
- PG_MASTER_REP_PASS=devops_rep
restart: always
build:
context: ./db/
args:
- mode=standby
depends_on:
- db.master
volumes:
vol_postgres:
networks:
net_postgres: