forked from quinncheong/IS213-driver-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
254 lines (235 loc) · 5.38 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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
version: "3.8"
volumes:
pgdata:
kongadata:
rabbitmq_data:
networks:
kong-net:
driver: bridge
services:
# For Message Queue Kafka
zookeeper:
image: 'bitnami/zookeeper:latest'
restart: always
networks:
- kong-net
ports:
- '2181:2181'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: 'bitnami/kafka:latest'
restart: always
networks:
- kong-net
ports:
- '9093:9093'
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://kafka:9093
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
depends_on:
- zookeeper
# End of Message Queue Kafka
####################################
# RabbitMQ: The messaging broker
####################################
rabbitmq:
image: rabbitmq:3-management
hostname: esd-rabbit
restart: always
networks:
- kong-net
ports:
# - "5672:5672"
- "15672:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
login:
build:
context: ./login
dockerfile: Dockerfile
image: ninjatruck/login:g5t7
restart: always
networks:
- kong-net
driver:
build:
context: ./driver
dockerfile: Dockerfile
image: ninjatruck/driver:g5t7
restart: always
networks:
- kong-net
parcel:
build:
context: ./parcel
dockerfile: Dockerfile
image: ninjatruck/parcel:g5t7
restart: always
networks:
- kong-net
customer:
build:
context: ./customer
dockerfile: Dockerfile
image: ninjatruck/customer:g5t7
restart: always
networks:
- kong-net
sms:
build:
context: ./sms-node
dockerfile: Dockerfile
image: ninjatruck/sms:g5t7
restart: always
networks:
- kong-net
depends_on:
- kafka
- zookeeper
email:
build:
context: ./email
dockerfile: Dockerfile
image: ninjatruck/email:g5t7
restart: always
networks:
- kong-net
depends_on:
- rabbitmq
- updateParcelStatus
loadDashboard:
build:
context: ./load_dashboard
dockerfile: Dockerfile
image: ninjatruck/load_dashboard:g5t7
restart: always
networks:
- kong-net
environment:
loginURL: 'http://login:5001/authenticate'
driverURL: 'http://driver:5002/driver'
parcelURL: 'http://parcel:5003/parcel'
# ports:
# - "5000:5000"
depends_on:
- login
- driver
- parcel
getDeliveryAddresses:
build:
context: ./get_delivery_addresses
dockerfile: Dockerfile
image: ninjatruck/get_delivery_addresses:g5t7
restart: always
networks:
- kong-net
environment:
customerURL: 'http://customer:5004/customer'
# ports:
# - "5010:5010"
depends_on:
- customer
updateParcelStatus:
build:
context: ./update_parcel_status
dockerfile: Dockerfile
image: ninjatruck/update_parcel_status:g5t7
restart: always
networks:
- kong-net
environment:
customerURL: 'http://customer:5004/customer'
parcelURL: 'http://parcel:5003/parcel'
rabbit_host: rabbitmq
rabbit_port: 5672
PYTHONUNBUFFERED: 1
# ports:
# - "5020:5020"
depends_on:
- parcel
- customer
- sms
- kafka
- rabbitmq
#######################################
# Postgres: The database used by Kong
#######################################
kong-database:
image: postgres:9.6
restart: always
networks:
- kong-net
environment:
POSTGRES_DB: kong
POSTGRES_USER: kong
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-U", "kong" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- pgdata:/var/lib/postgresql/data
#######################################
# Kong database migration
#######################################
kong-migration:
image: kong:2.0.4
command: "kong migrations bootstrap"
restart: on-failure
networks:
- kong-net
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_USER: kong
KONG_PG_PASSWORD: password
depends_on:
- kong-database
#######################################
# Kong: The API Gateway
#######################################
kong:
image: kong:2.0.4
restart: always
networks:
- kong-net
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_USER: kong
KONG_PG_PASSWORD: password
KONG_PROXY_LISTEN: 0.0.0.0:8000
KONG_ADMIN_LISTEN: 0.0.0.0:8001
depends_on:
- kong-migration
ports:
- "8000:8000"
#######################################
# Konga: Kong GUI
#######################################
konga:
image: pantsel/konga
restart: always
networks:
- kong-net
environment:
DB_ADAPTER: postgres
DB_HOST: kong-database
DB_USER: kong
DB_PASSWORD: password
DB_DATABASE: konga_db
depends_on:
- kong
ports:
- "1337:1337"
volumes:
- kongadata:/app/kongadata