-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-db.yaml
70 lines (65 loc) · 1.43 KB
/
docker-compose-db.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
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
services:
postgres:
container_name: postgres-master
image: postgres:16.2
environment:
- POSTGRES_USER=${DATABASE_USERNAME}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
volumes:
- pg-volume:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
medium-articles-api-network:
ipv4_address: ${DABASE_HOST}
replica:
container_name: postgres-replica
image: postgres:16.2
environment:
- POSTGRES_USER=${REPLICA_USERNAME}
- POSTGRES_PASSWORD=${REPLICA_PASSWORD}
volumes:
- re-volume:/var/lib/postgresql/data
ports:
- "5433:5432"
networks:
medium-articles-api-network:
ipv4_address: ${REPLICA_HOST}
depends_on:
- postgres
redis:
container_name: redis-cache
image: redis:7.2.4
volumes:
- redis-volume:/data
ports:
- "6379:6379"
networks:
medium-articles-api-network:
ipv4_address: ${REDIS_HOST}
volumes:
pg-volume:
driver: local
driver_opts:
type: none
o: bind
device: ${VOLUME_POSTGRES}
re-volume:
driver: local
driver_opts:
type: none
o: bind
device: ${VOLUME_REPLICA}
redis-volume:
driver: local
driver_opts:
type: none
o: bind
device: ${VOLUME_REDIS}
networks:
medium-articles-api-network:
driver: bridge
ipam:
config:
- subnet: ${SUBNET_CIDR}
gateway: ${GATEWAY_HOST}