-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
215 lines (207 loc) · 4.8 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
version: '3'
networks:
orderly-net:
driver: bridge
external: false
volumes:
ms_checkin_db:
ms_checkout_db:
ms_financial_db:
# kong_data: {}
services:
rabbitmq:
build: ./infra/rabbitmq
container_name: rabbitmq-server
env_file: ./infra/rabbitmq/.env
environment:
- RABBITMQ_ERLANG_COOKIE=TRIBUFUSTACK
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=admin
networks:
- orderly-net
healthcheck:
test: ["CMD", "curl", "-f", "http://rabbitmq:15672"]
interval: 30s
timeout: 10s
retries: 5
kong:
build: ./infra/kong
container_name: kong-stateless
volumes:
- ./infra/kong/kong-config.yml:/tmp/kong-config.yml
environment:
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /tmp/kong-config.yml
KONG_PLUGINS: bundled
restart: always
healthcheck:
test: [ "CMD", "kong", "health" ]
interval: 10s
timeout: 10s
retries: 10
networks:
- orderly-net
ports:
# - 8000:8000 # disponivel para uso
# - 8001:8001 # api do kong
- 8444:8444
- 8443:8443
nginx:
build: ./infra/nginx
container_name: nginx-proxy
ports:
- 80:80
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3
networks:
- orderly-net
depends_on:
- ms_checkin
- kong
# checkin
ms_checkin_db:
build: ./infra/postgres
container_name: ms-checkin-database
env_file:
- ./ms-checkin/.env.production
environment:
- POSTGRES_USER=checkin_user
- POSTGRES_PASSWORD=checkin_password
- POSTGRES_DB=checkin_database
- PGDATA=/data/postgres
volumes:
- ms_checkin_db:/data/postgres
networks:
- orderly-net
restart: unless-stopped
ms_checkin:
build: ./ms-checkin
container_name: ms-checkin-api
volumes:
- ./ms-checkin:/usr/checkin/api
networks:
- orderly-net
depends_on:
- ms_checkin_db
- rabbitmq
restart: always
links:
- ms_checkin_db
- rabbitmq
env_file:
- ./ms-checkin/.env.production
healthcheck:
test: ["CMD", "curl", "--fail", "http://ms_checkin:3001/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
# checkout
ms_checkout_db:
build: ./infra/postgres
container_name: ms-checkout-database
env_file:
- ./ms-checkout/.env.production
environment:
- POSTGRES_USER=checkout_user
- POSTGRES_PASSWORD=checkout_password
- POSTGRES_DB=checkout_database
- PGDATA=/data/postgres
volumes:
- ms_checkout_db:/data/postgres
networks:
- orderly-net
restart: unless-stopped
ms_checkout:
build: ./ms-checkout
container_name: ms-checkout-api
volumes:
- ./ms-checkout:/usr/checkout/api
networks:
- orderly-net
restart: on-failure
depends_on:
- ms_checkout_db
- rabbitmq
links:
- ms_checkout_db
- rabbitmq
env_file:
- ./ms-checkout/.env.production
healthcheck:
test: ["CMD", "curl", "--fail", "http://ms_checkout:3002/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
# financial
ms_financial_db:
build: ./infra/postgres
container_name: ms-financial-database
env_file:
- ./ms-financial/.env.production
environment:
- POSTGRES_USER=financial_user
- POSTGRES_PASSWORD=financial_password
- POSTGRES_DB=financial_database
- PGDATA=/data/postgres
volumes:
- ms_financial_db:/data/postgres
networks:
- orderly-net
restart: unless-stopped
ms_financial:
build: ./ms-financial
container_name: ms-financial-api
volumes:
- ./ms-financial:/usr/financial/api
networks:
- orderly-net
depends_on:
- ms_financial_db
- rabbitmq
restart: on-failure
links:
- ms_financial_db
- rabbitmq
env_file:
- ./ms-financial/.env.production
healthcheck:
test: ["CMD", "curl", "--fail", "http://ms_financial:3003/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
# auth
ms_auth_db:
image: mongo
container_name: ms-auth-database
restart: always
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root_password
env_file:
- ./ms-auth/.env.production
networks:
- orderly-net
ms_auth:
build: ./ms-auth
container_name: ms-auth-api
volumes:
- ./ms-auth:/usr/auth/api
networks:
- orderly-net
depends_on:
- ms_auth_db
restart: on-failure
links:
- ms_auth_db
env_file:
- ./ms-auth/.env.production