forked from wayglem/fit-company
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
225 lines (213 loc) · 5.12 KB
/
docker-compose.yml
File metadata and controls
225 lines (213 loc) · 5.12 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
version: "3.7"
services:
monolith:
build:
context: .
dockerfile: monolith.Dockerfile
ports:
- "12101:5000"
volumes:
- ./src/fit:/app/src/fit
links:
- monolith-db
- rabbitmq
environment:
- DATABASE_URL=postgresql://postgres:docker@monolith-db:5432/fit-db
- FIT_API_KEY=some_very_secret_key
- COACH_URL=http://coach:5000
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_DEFAULT_USER=rabbit
- RABBITMQ_DEFAULT_PASS=docker
networks:
- fit
# entrypoint: ["flask", "run"]
depends_on:
rabbitmq:
condition: service_healthy
monolith-db:
condition: service_healthy
coach:
build:
context: .
dockerfile: coach.Dockerfile
ports:
- "12102:5000"
volumes:
- ./src/coach:/app/src/coach
links:
- coach-db
- rabbitmq
environment:
- MONOLITH_URL=http://monolith:5000
- FIT_API_KEY=some_very_secret_key
- COACH_URL=http://coach:5000
- BILLING_URL=http://billing:5000
- DATABASE_URL=postgresql://postgres:docker@coach-db:5432/coach-db
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_DEFAULT_USER=rabbit
- RABBITMQ_DEFAULT_PASS=docker
networks:
- fit
depends_on:
rabbitmq:
condition: service_healthy
billing:
condition: service_healthy
stats:
build:
context: .
dockerfile: stats.Dockerfile
ports:
- "12110:5000"
volumes:
- ./src/stats:/app/src/stats
links:
- stats-db
- rabbitmq
environment:
- MONOLITH_URL=http://monolith:5000
- FIT_API_KEY=some_very_secret_key
- DATABASE_URL=postgresql://postgres:docker@stats-db:5432/stats-db
- COACH_URL=http://coach:5000
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_DEFAULT_USER=rabbit
- RABBITMQ_DEFAULT_PASS=docker
networks:
- fit
depends_on:
rabbitmq:
condition: service_healthy
billing:
build:
context: .
dockerfile: billing.Dockerfile
ports:
- "12111:5000"
volumes:
- ./src/billing:/app/src/billing
links:
- billing-db
- rabbitmq
environment:
- MONOLITH_URL=http://monolith:5000
- FIT_API_KEY=some_very_secret_key
- DATABASE_URL=postgresql://postgres:docker@billing-db:5432/billing-db
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_DEFAULT_USER=rabbit
- RABBITMQ_DEFAULT_PASS=docker
- BILLING_URL=http://billing:5000
networks:
- fit
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
depends_on:
rabbitmq:
condition: service_healthy
billing-db:
condition: service_healthy
monolith-db:
image: postgres:latest
ports:
- "12100:5432"
command: postgres -c max_connections=200
user: postgres
environment:
- POSTGRES_DB=fit-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=docker
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "fit-db"]
interval: 5s
timeout: 30s
retries: 5
networks:
- fit
coach-db:
image: postgres:latest
ports:
- "12103:5432"
command: postgres -c max_connections=200
user: postgres
environment:
- POSTGRES_DB=coach-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=docker
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "coach-db"]
interval: 5s
timeout: 30s
retries: 5
networks:
- fit
stats-db:
image: postgres:latest
ports:
- "12120:5432"
command: postgres -c max_connections=200
user: postgres
environment:
- FIT_API_KEY=some_very_secret_key
- POSTGRES_DB=stats-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=docker
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "stats-db"]
interval: 5s
timeout: 30s
retries: 5
networks:
- fit
billing-db:
image: postgres:latest
ports:
- "12121:5432"
command: postgres -c max_connections=200
user: postgres
environment:
- POSTGRES_DB=billing-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=docker
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "billing-db"]
interval: 5s
timeout: 30s
retries: 5
networks:
- fit
notification:
build:
context: .
dockerfile: notification.Dockerfile
volumes:
- ./src/notification:/app
ports:
- "12112:5005"
depends_on:
- billing
- rabbitmq
environment:
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_DEFAULT_USER=rabbit
- RABBITMQ_DEFAULT_PASS=docker
networks:
- fit
rabbitmq:
image: rabbitmq:3-management
ports:
- "12104:5672" # AMQP protocol port
- "12105:15672" # Management interface port
environment:
- RABBITMQ_DEFAULT_USER=rabbit
- RABBITMQ_DEFAULT_PASS=docker
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
interval: 5s
timeout: 30s
retries: 5
networks:
- fit
networks:
fit: