forked from AlmirFonseca/A2_computacao_escalavel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
184 lines (169 loc) · 4.12 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
services:
postgres:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
zookeeper:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ports:
- "2181:2181"
kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
ports:
- "9092:9092"
expose:
- "9093"
depends_on:
- zookeeper
restart: on-failure
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
create_tables:
image: create_tables:latest
build: ./mock
depends_on:
- postgres
volumes:
- ./mock:/app
command: python create_tables.py
insert_data:
image: insert_data:latest
build: ./mock
depends_on:
- create_tables
- postgres
- webhook
- kafka
environment:
- WEBHOOK_HOST=webhook
- WEBHOOK_PORT=5000
- KAFKA_BROKER=kafka:9093
- INPUT_TOPIC=users_bonus
volumes:
- ./mock:/app
command: python main.py
data-processor-app:
image: data_processor:latest
build: ./server
restart: on-failure
depends_on:
- create_tables
- postgres
environment:
- DB_NAME=mydatabase
- DB_USER=myuser
- DB_PASSWORD=mypassword
- DB_HOST=postgres
- DB_PORT=5432
- REDIS_HOST=redis
- REDIS_PORT=6379
volumes:
- ./mock/mock_files:/processor/mock_files
- ./tasks:/processor/tasks
command: python data_processor.py
dash_app:
build: ./dash_app
container_name: dash_app
ports:
- "5000:5000"
depends_on:
- redis
volumes:
- ./dash_app:/app
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
bonus-system:
build: ./bonus
depends_on:
- redis
- postgres
- kafka
environment:
- KAFKA_BROKER=kafka:9093
- OUTPUT_TOPIC=users_bonus
- DB_NAME=mydatabase
- DB_USER=myuser
- DB_PASSWORD=mypassword
- DB_HOST=postgres
- DB_PORT=5432
volumes:
- ./bonus/jars:/bonus/jars # This is to avoid downloading the jars every time the container is created
command: python bonus_system.py
webhook:
image: webhook:latest
build: ./events
depends_on:
- kafka
environment:
- KAFKA_BROKER=kafka:9093
- OUTPUT_TOPIC=events
command: python webhook.py
queue_consumer:
build: ./events
container_name: queue_consumer
depends_on:
- kafka
environment:
- KAFKA_BROKER=kafka:9093
- INPUT_TOPIC=events
- OUTPUT_TOPIC=events_batch
- DB_NAME=mydatabase
- DB_USER=myuser
- DB_PASSWORD=mypassword
- DB_HOST=postgres
- DB_PORT=5432
- REDIS_HOST=redis
- REDIS_PORT=6379
command: python -u queue_consumer.py
price-monitor:
build: ./price_monitor
container_name: price_monitor
depends_on:
- postgres
- redis
environment:
- DB_NAME=mydatabase
- DB_USER=myuser
- DB_PASSWORD=mypassword
- DB_HOST=postgres
- DB_PORT=5432
command: python price_monitor.py
price-updater:
build: ./update_price
depends_on:
- postgres
- insert_data
environment:
- POSTGREE_CREDENTIALS__DBNAME=mydatabase
- POSTGREE_CREDENTIALS__USER=myuser
- POSTGREE_CREDENTIALS__PASSWORD=mypassword
- POSTGREE_CREDENTIALS__HOST=postgres
- POSTGREE_CREDENTIALS__PORT=5432
volumes:
- ./update_price:/app
command: python update_prices.py
volumes:
postgres_data: