generated from delftdata/wdm-project-template
/
docker-compose.yml
128 lines (118 loc) · 3.18 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
services:
gateway:
image: nginx
depends_on:
- order-service
- payment-service
- stock-service
volumes:
- ./gateway_nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "8000:80"
order-service:
build: ./order
image: ptemarvelde/wdm-2022:order
environment:
- GATEWAY_URL=http://gateway:80
- LOG_LEVEL=DEBUG
# command: gunicorn -b 0.0.0.0:5000 app:app --timeout 0
command: uvicorn app:app --host 0.0.0.0 --port 5000
depends_on:
order-postgres-service:
condition: service_healthy
rabbitmq:
condition: service_healthy
env_file:
- env/order_postgres.env
order-postgres-service:
image: postgres:14.1-alpine
env_file:
- env/order_postgres.env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
interval: 5s
timeout: 5s
retries: 5
stock-service:
build: ./stock
image: ptemarvelde/wdm-2022:stock
environment:
- GATEWAY_URL=http://gateway:80
- LOG_LEVEL=DEBUG
depends_on:
stock-postgres-service:
condition: service_healthy
rabbitmq:
condition: service_healthy
# command: gunicorn -b 0.0.0.0:5000 app:app --timeout 0
command: uvicorn app:app --host 0.0.0.0 --port 5000
env_file:
- env/stock_postgres.env
stock-postgres-service:
image: postgres:14.1-alpine
env_file:
- env/stock_postgres.env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
interval: 5s
timeout: 5s
retries: 5
stock-queue:
build: ./stock
image: ptemarvelde/wdm-2022:stock-queue
command: python consumer.py
depends_on:
stock-postgres-service:
condition: service_healthy
rabbitmq:
condition: service_healthy
environment:
- LOG_LEVEL=INFO
env_file:
- env/stock_postgres.env
payment-service:
build: ./payment
image: ptemarvelde/wdm-2022:user
# command: gunicorn -w 4 -b 0.0.0.0:5000 app:app --worker-class uvicorn.workers.UvicornWorker
command: uvicorn app:app --host 0.0.0.0 --port 5000
depends_on:
payment-postgres-service:
condition: service_healthy
rabbitmq:
condition: service_healthy
environment:
- LOG_LEVEL=DEBUG
env_file:
- env/payment_postgres.env
payment-postgres-service:
image: postgres:14.1-alpine
env_file:
- env/payment_postgres.env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
interval: 5s
timeout: 5s
retries: 5
payment-queue:
build: ./payment
image: ptemarvelde/wdm-2022:payment-queue
command: python consumer.py
depends_on:
stock-postgres-service:
condition: service_healthy
rabbitmq:
condition: service_healthy
environment:
- LOG_LEVEL=INFO
env_file:
- env/payment_postgres.env
rabbitmq:
image: 'rabbitmq:3.10-management'
ports:
- '5672:5672'
- '15672:15672'
healthcheck:
test: [ "CMD-SHELL", "rabbitmq-diagnostics -q check_port_connectivity" ]
interval: 5s
timeout: 5s
retries: 5