-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
264 lines (253 loc) · 6.04 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
version: "3.3"
services:
postgres:
image: postgres:14.1
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_DB: "${POSTGRES_DB}"
expose:
- "5432"
networks:
- network
restart: always
volumes:
- postgres-data:/var/lib/postgresql/data/
logging:
driver: 'json-file'
options:
max-size: 20m
client:
build:
context: ./web-app/
dockerfile: Dockerfile-client
ports:
- "3000:3000"
expose:
- "4000"
environment:
NEXT_PUBLIC_HOST_SERVER_IP: ${HOST_SERVER_IP}
NEXT_SSR_SERVER_IP: server
NEXT_PUBLIC_SERVER_PORT: 5000
NEXT_PUBLIC_SERVER_PROTOCOL: ${SERVER_PROTOCOL}
NEXT_PUBLIC_PASSWORD_SALT_PREFIX: ${PASSWORD_SALT_PREFIX}
NEXT_PUBLIC_PASSWORD_SALT_POSTFIX: ${PASSWORD_SALT_POSTFIX}
PORT: 3000
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./grafana-users:/etc/nginx/grafana_passw
depends_on:
- server
networks:
- network
restart: always
logging:
driver: 'json-file'
options:
max-size: 20m
server:
build:
context: ./web-app/
dockerfile: Dockerfile-server
environment:
IS_IN_DOCKER: 'true'
DB_NAME: "${POSTGRES_DB}"
DB_USER: "${POSTGRES_USER}"
DB_PASSWORD: "${POSTGRES_PASSWORD}"
DB_HOST: postgres
DB_PORT: 5432
DB_FORCE_TABLES_RECREATION: ${DB_FORCE_TABLES_RECREATION}
NODE_ENV: ${NODE_ENV}
SERVER_PORT: 5000
SERVER_HOST: 0.0.0.0
KAFKA_HOST: kafka
KAFKA_SERVER_PORT: 9092
KAFKA_ADMIN_CLIENT_ID: "${KAFKA_ADMIN_CLIENT_ID}"
KAFKA_TOPIC_NAME: tasks
MAX_THREADS_COUNT: 8
SECRET_KEY: ${SECRET_KEY}
POSTFIX_ENABLED: ${POSTFIX_ENABLED}
POSTFIX_HOST: postfix
POSTFIX_EMAIL: ${POSTFIX_EMAIL}
ports:
- "5000:5000"
depends_on:
- postgres
- kafka
- python-consumer
- postfix
volumes:
- uploads:/server/uploads/
- datasets:/server/build/target/input_data/
networks:
- network
restart: always
logging:
driver: 'json-file'
options:
max-size: 20m
postfix:
build:
context: ./web-app/
dockerfile: Dockerfile-postfix
environment:
POSTFIX_RELAY: ${POSTFIX_RELAY}
POSTFIX_EMAIL: ${POSTFIX_EMAIL}
POSTFIX_PASS: ${POSTFIX_PASS}
POSTFIX_ADMINEMAIL: ${POSTFIX_ADMINEMAIL}
networks:
- network
restart: always
logging:
driver: 'json-file'
options:
max-size: 20m
zookeeper:
image: confluentinc/cp-zookeeper:7.0.0
user: root
expose:
- "2181"
environment:
ALLOW_ANONYMOUS_LOGIN: 'yes'
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
networks:
- network
restart: always
volumes:
- ./volumes/logs/zk/:/var/lib/zookeeper/log
- ./volumes/data/zk/:/var/lib/zookeeper/data
logging:
driver: 'json-file'
options:
max-size: 20m
kafka:
image: confluentinc/cp-kafka:7.0.0
user: root
expose:
- '9092'
- '1234'
links:
- 'prometheus'
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
ALLOW_PLAINTEXT_LISTENER: 'yes'
KAFKA_LISTENERS: 'PLAINTEXT://:9092'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:9092'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_OPTS: '-javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.15.0.jar=1234:/opt/prometheus/kafka_broker.yml'
depends_on:
- zookeeper
- prometheus
networks:
- network
restart: always
volumes:
- ./volumes/logs/kafka/:/var/log/kafka
- ./volumes/data/kafka/:/var/lib/kafka/data
- ./web-app/prometheus/kafka/:/opt/prometheus/
logging:
driver: 'json-file'
options:
max-size: 20m
python-consumer:
build:
context: ./python-consumer
dockerfile: Dockerfile
depends_on:
- kafka
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- uploads:/server/uploads/
networks:
- network
environment:
TIMELIMIT: ${CONSUMER_TL_SEC}
MAX_RAM: ${CONSUMER_ML_MB}
KAFKA_HOST: kafka
KAFKA_PORT: 9092
MAX_ACTIVE_TASKS: ${MAX_ACTIVE_TASKS}
DOCKER_NETWORK: desbordante_network
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DBNAME: "${POSTGRES_DB}"
DB_TASKS_TABLE_NAME: "TasksState"
restart: always
logging:
driver: 'json-file'
options:
max-size: 20m
prometheus:
image: prom/prometheus
volumes:
- ./web-app/prometheus/:/etc/prometheus/
networks:
- network
expose:
- '9090'
links:
- 'grafana'
node-exporter:
image: prom/node-exporter
container_name: monitoring_node_exporter
restart: always
networks:
- network
expose:
- 9100
links:
- 'prometheus'
volumes:
- '/:/host:ro,rslave'
command:
- '--path.rootfs=/host'
pid: host
cadvisor:
image: google/cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
restart: always
privileged: true
networks:
- network
expose:
- '8080'
links:
- 'prometheus'
grafana:
image: grafana/grafana
networks:
- network
expose:
- '3000'
volumes:
- ./volumes/data/grafana/:/var/lib/grafana/
- ./web-app/grafana/:/etc/grafana/
networks:
network:
volumes:
uploads:
driver: local
driver_opts:
type: 'volume'
o: 'bind'
device: '${PWD}/volumes/uploads/'
postgres-data:
driver: local
driver_opts:
type: 'volume'
o: 'bind'
device: '${PWD}/volumes/postgres-data/'
datasets:
driver: local
driver_opts:
type: 'volume'
o: 'bind'
device: '${PWD}/volumes/datasets/'