-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.microservices.yml
92 lines (86 loc) · 2.73 KB
/
docker-compose.microservices.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
version: '3.8'
services:
failed_order_handler:
build:
context: ./microservices/failed_order_handler
restart: unless-stopped
command: ["/wait-for-it.sh", "-t", "60", "rabbitmq:5672", "--", "python", "-m", "app.main"]
environment:
RABBITMQ_URL: "amqp://admin:admin@rabbitmq/"
REDIS_URL: "redis://redis:6379"
depends_on:
- rabbitmq
deploy:
replicas: 1
order_generation:
build:
context: ./microservices/order_generation
restart: unless-stopped
command: ["/wait-for-it.sh", "-t", "60", "rabbitmq:5672", "--", "hypercorn", "app.main:app", "--bind", "0.0.0.0:8000"]
environment:
RABBITMQ_URL: "amqp://admin:admin@rabbitmq/"
DEBUG: True
TESTING: False
API_TITLE: "Event-driven Architecture Simulator"
API_VERSION: "v1"
depends_on:
- rabbitmq
expose:
- "8000"
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.ratelimiter.ratelimit.burst=200"
- "traefik.http.middlewares.ratelimiter.ratelimit.average=1000"
- "traefik.http.routers.order_generation.middlewares=ratelimiter"
- "traefik.http.routers.order_generation.rule=Host(`localhost`)"
- "traefik.http.routers.order_generation.entrypoints=web"
deploy:
replicas: 3
order_processing:
build:
context: ./microservices/order_processing
restart: unless-stopped
command: ["/wait-for-it.sh", "-t", "60", "rabbitmq:5672", "--", "python", "-m", "app.main"]
environment:
RABBITMQ_URL: "amqp://admin:admin@rabbitmq/"
REDIS_URL: "redis://redis:6379"
depends_on:
- rabbitmq
deploy:
replicas: 3
payment_processing:
build:
context: ./microservices/payment_processing
restart: unless-stopped
command: ["/wait-for-it.sh", "-t", "60", "rabbitmq:5672", "--", "python", "-m", "app.main"]
environment:
RABBITMQ_URL: "amqp://admin:admin@rabbitmq/"
REDIS_URL: "redis://redis:6379"
depends_on:
- rabbitmq
deploy:
replicas: 2
shipment_management:
build:
context: ./microservices/shipment_management
restart: unless-stopped
command: ["/wait-for-it.sh", "-t", "60", "rabbitmq:5672", "--", "python", "-m", "app.main"]
environment:
RABBITMQ_URL: "amqp://admin:admin@rabbitmq/"
REDIS_URL: "redis://redis:6379"
depends_on:
- rabbitmq
deploy:
replicas: 1
notification:
build:
context: ./microservices/notification
restart: unless-stopped
command: ["/wait-for-it.sh", "-t", "60", "rabbitmq:5672", "--", "python", "-m", "app.main"]
environment:
RABBITMQ_URL: "amqp://admin:admin@rabbitmq/"
REDIS_URL: "redis://redis:6379"
depends_on:
- rabbitmq
deploy:
replicas: 1