-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
175 lines (167 loc) · 4.26 KB
/
docker-compose.yml
File metadata and controls
175 lines (167 loc) · 4.26 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
version: "3.9"
services:
mysql-users:
image: mysql:8.0
container_name: mysql-users
restart: "no"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: user_db
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3307:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 20
mysql-products:
image: mysql:8.0
container_name: mysql-products
restart: "no"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: product_db
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3308:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 20
mysql-orders:
image: mysql:8.0
container_name: mysql-orders
restart: "no"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: order_db
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3309:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 20
localstack:
image: localstack/localstack:3.3
container_name: localstack
restart: "no"
stop_grace_period: 20s
environment:
SERVICES: sqs
DEBUG: "1"
AWS_DEFAULT_REGION: us-east-1
ports:
- "4566:4566"
volumes:
- ./localstack:/etc/localstack/init/ready.d
- /var/run/docker.sock:/var/run/docker.sock
user_service:
build: ./user_service
container_name: user_service
restart: "no"
stop_grace_period: 20s
environment:
DB_HOST: mysql-users
DB_USER: user
DB_PASSWORD: password
DB_NAME: user_db
FLASK_RUN_PORT: "8082"
ADMIN_USERNAME: admin
ADMIN_EMAIL: admin@example.com
ADMIN_PASSWORD: admin123
RESET_ADMIN_PASSWORD: "true"
COVERAGE: "1"
depends_on:
mysql-users:
condition: service_healthy
ports:
- "8082:8082"
volumes:
- ./coverage:/coverage
- ./user_service/coverage:/svc_coverage
product_service:
build: ./product_service
container_name: product_service
restart: "no"
stop_grace_period: 20s
environment:
DB_HOST: mysql-products
DB_USER: user
DB_PASSWORD: password
DB_NAME: product_db
FLASK_RUN_PORT: "8081"
COVERAGE: "1"
depends_on:
mysql-products:
condition: service_healthy
ports:
- "8081:8081"
volumes:
- ./coverage:/coverage
- ./product_service/coverage:/svc_coverage
order_service:
build: ./order_service
container_name: order_service
restart: "no"
stop_grace_period: 20s
environment:
DB_HOST: mysql-orders
DB_USER: user
DB_PASSWORD: password
DB_NAME: order_db
USER_SERVICE_URL: http://user_service:8082/api/v1
PRODUCT_SERVICE_URL: http://product_service:8081/api/v1
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT: http://localstack:4566
SQS_QUEUE_URL: http://localstack:4566/000000000000/order-events
FLASK_RUN_PORT: "8080"
COVERAGE: "1"
depends_on:
mysql-orders:
condition: service_healthy
user_service:
condition: service_started
product_service:
condition: service_started
localstack:
condition: service_started
ports:
- "8080:8080"
volumes:
- ./coverage:/coverage
- ./order_service/coverage:/svc_coverage
apigateway:
build: ./apigateway
container_name: apigateway
restart: "no"
stop_grace_period: 20s
environment:
USER_SERVICE_URL: http://user_service:8082/api/v1
PRODUCT_SERVICE_URL: http://product_service:8081/api/v1
ORDER_SERVICE_URL: http://order_service:8080/api/v1
FLASK_RUN_PORT: "8083"
COVERAGE: "1"
depends_on:
user_service:
condition: service_started
product_service:
condition: service_started
order_service:
condition: service_started
ports:
- "8083:8083"
volumes:
- ./coverage:/coverage
- ./apigateway/coverage:/svc_coverage