-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
243 lines (229 loc) · 5.87 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
version: '3'
services:
main:
build: .
image: opuscapita/email-gateway:dev
depends_on:
- redis
- mysql
- consul
- registrator
- kong
- user
- acl
- auth
- api-registry
- rabbitmq
- kafka1
labels:
SERVICE_NAME: 'email-gateway'
SERVICE_TAGS: 'external'
environment:
NODE_ENV: 'development'
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASS: ${RABBITMQ_PASS}
REDIS_AUTH: ${REDIS_AUTH}
SERVICE_3054_NAME: email-gateway
SERVICE_3054_CHECK_HTTP: /api/health/check
SERVICE_3054_CHECK_INTERVAL: 15s
SERVICE_3054_CHECK_TIMEOUT: 3s
ports:
- '${PORT}:${PORT}'
mysql:
image: 'mysql:5.7'
ports:
- '3306:3306'
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
SERVICE_3306_NAME: mysql
depends_on:
- registrator
registrator:
image: gliderlabs/registrator
command: consul://consul:8500
volumes:
- /var/run/docker.sock:/tmp/docker.sock
depends_on:
- consul
redis:
image: opuscapita/redis:dev
ports:
- '6379:6379'
environment:
REDIS_AUTH: ${REDIS_AUTH}
depends_on:
- registrator
user:
image: opuscapita/user:dev
depends_on:
- mysql
- consul
- registrator
- redis
- acl
- rabbitmq
labels:
SERVICE_NAME: 'user'
SERVICE_TAGS: 'external,kong'
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
REDIS_AUTH: ${REDIS_AUTH}
SERVICE_3008_CHECK_HTTP: /api/health/check
SERVICE_3008_CHECK_INTERVAL: 15s
SERVICE_3008_CHECK_TIMEOUT: 3s
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASS: ${RABBITMQ_PASS}
ports:
- '3008:3008'
command: 'npm run dev:production'
acl:
image: opuscapita/acl:dev
labels:
- 'SERVICE_NAME=acl'
- 'SERVICE_TAGS=external,kong'
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
REDIS_AUTH: ${REDIS_AUTH}
SERVICE_3013_CHECK_HTTP: /api/health/check
SERVICE_3013_CHECK_INTERVAL: 15s
SERVICE_3013_CHECK_TIMEOUT: 3s
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASS: ${RABBITMQ_PASS}
ports:
- '3013:3013'
depends_on:
- mysql
- registrator
command: 'npm run dev:production'
auth:
image: opuscapita/auth:dev
ports:
- '3005:3005'
environment:
GATEWAY_SCHEME: 'http'
GATEWAY_IP: 'localhost'
GATEWAY_PORT: '8080'
GATEWAY_CALLBACK: 'auth/callback'
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
MYSQL_DATABASE: $MYSQL_DATABASE
REDIS_AUTH: ${REDIS_AUTH}
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASS: ${RABBITMQ_PASS}
SERVICE_3005_CHECK_HTTP: /auth/certs
SERVICE_3005_CHECK_INTERVAL: 15s
SERVICE_3005_CHECK_TIMEOUT: 3s
depends_on:
- kong
- consul
command: 'npm run dev:production'
kong:
image: opuscapita/kong:dev
environment:
KONG_DATABASE: 'postgres'
KONG_PG_HOST: '172.17.0.1'
KONG_PG_PORT: '5432'
APP_HOST: ${HOST_IP}
APP_HOST_PROTOCOL: 'http'
APP_HOST_PORT: 3005
GATEWAY_SCHEME: 'http'
GATEWAY_IP: 'localhost'
GATEWAY_PORT: '8080'
GATEWAY_CALLBACK: 'auth/callback'
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
REDIS_HOST: ${HOST_IP}
REDIS_PORT: 6379
REDIS_AUTH: ${REDIS_AUTH}
SERVICE_8001_NAME: 'kong'
SERVICE_8080_NAME: 'kong-http'
ports:
- '8080:8080'
- '8443:8443'
- '8001:8001'
- '7946:7946'
- '7946:7946/udp'
depends_on:
- postgres
- mysql
- redis
api-registry:
image: opuscapita/api-registrator:dev
ports:
- '3004:3004'
environment:
SERVICE_3004_CHECK_HTTP: /api/health/check
SERVICE_3004_CHECK_INTERVAL: 15s
SERVICE_3004_CHECK_TIMEOUT: 3s
depends_on:
- kong
postgres:
image: postgres:9.4
ports:
- '5432:5432'
environment:
POSTGRES_USER: ${POSTGRES_DB}
POSTGRES_DB: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
depends_on:
- registrator
rabbitmq:
image: rabbitmq:3-management
ports:
- '4369:4369'
- '5671:5671'
- '5672:5672'
- '15672:15672'
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS}
SERVICE_5672_NAME: 'rabbitmq-amqp'
redis:
image: opuscapita/redis:dev
ports:
- '6379:6379'
environment:
REDIS_AUTH: ${REDIS_AUTH}
depends_on:
- registrator
consul:
image: consul:1.4
ports:
- '8400:8400'
- '8500:8500'
- '8600:53/udp'
labels:
SERVICE_IGNORE: 'true' # Do not add any of Consul's services to Consul's service discovery registry.
command: [agent, '-server', '-ui', '-bootstrap', '-client=0.0.0.0']
zoo1:
image: 'zookeeper:3.4.14'
restart: always
hostname: zoo1
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888
depends_on:
- acl
kafka1:
image: wurstmeister/kafka
ports:
- '9092:9092'
environment:
KAFKA_BROKER_ID: 1
# KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
KAFKA_NUM_PARTITIONS: 10
KAFKA_DEFAULT_REPLICATION_FACTOR: 1
KAFKA_PORT: 9092
KAFKA_ADVERTISED_HOST_NAME: 'kafka1'
KAFKA_LISTENERS: 'PLAINTEXT://:9092'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka1:9092'
KAFKA_ZOOKEEPER_CONNECT: zoo1:2181
depends_on:
- zoo1