-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
88 lines (84 loc) · 1.69 KB
/
docker-compose.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# This is used for testing purposes only
# docker-comose version
version: "3.8"
services:
postgres:
image: postgres
env_file: .envdocker
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: postgres
networks:
- postgres_ntw
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 2s
timeout: 5s
retries: 5
# 1
redis1:
image: redis
command: redis-server --save 60 1 --loglevel warning
networks:
- engine1_ntw
engine1:
build: .
env_file: .envdocker
environment:
ENVIRONMENT: prod
depends_on:
redis1:
condition: service_started
postgres:
condition: service_healthy
networks:
- postgres_ntw
- engine1_ntw
# 2
redis2:
image: redis
command: redis-server --save 60 1 --loglevel warning
networks:
- engine2_ntw
engine2:
build: .
env_file: .envdocker
environment:
ENVIRONMENT: prod
depends_on:
redis1:
condition: service_started
postgres:
condition: service_healthy
networks:
- postgres_ntw
- engine2_ntw
# 3
redis3:
image: redis
command: redis-server --save 60 1 --loglevel warning
networks:
- engine3_ntw
engine3:
build: .
env_file: .envdocker
environment:
ENVIRONMENT: prod
depends_on:
redis3:
condition: service_started
postgres:
condition: service_healthy
networks:
- postgres_ntw
- engine3_ntw
networks:
postgres_ntw:
driver: bridge
engine1_ntw:
driver: bridge
engine2_ntw:
driver: bridge
engine3_ntw:
driver: bridge