forked from Mahmoud-nfz/football-big-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
153 lines (141 loc) · 3.41 KB
/
docker-compose.yaml
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
services:
search-engine:
build: ./search
ports:
- 5000:5000
volumes:
- ./data:/usr/src/data
web:
platform: "linux/amd64"
build:
context: ./web
ports:
- 3010:3010
- 3011:3011
environment:
DB_HOST: "rethinkdb"
DB_PORT: "28015"
DB_NAME: "football"
PORT: "3010"
SEARCH_ENGINE_URL: "http://search-engine:5000"
networks:
- rethinkdb-net
namenode:
build:
context: ./hadoop
hostname: namenode
command: ["bash", "-c", "./start.sh"]
ports:
- 9870:9870
environment:
ENSURE_NAMENODE_DIR: "/tmp/hadoop-root/dfs/name"
volumes:
- ./hadoop/config:/opt/hadoop/etc/hadoop
- ./data/football-events:/opt/hadoop/data
- ./hadoop/scripts/start-namenode.sh:/opt/hadoop/start.sh
networks:
- hadoop-net
datanode:
depends_on:
- namenode
build:
context: ./hadoop
command: ["hdfs", "datanode"]
volumes:
- ./hadoop/config:/opt/hadoop/etc/hadoop
networks:
- hadoop-net
resourcemanager:
build:
context: ./hadoop
hostname: resourcemanager
command: ["yarn", "resourcemanager"]
ports:
- 8088:8088
volumes:
- ./hadoop/config:/opt/hadoop/etc/hadoop
networks:
- hadoop-net
nodemanager:
build:
context: ./hadoop
command: ["yarn", "nodemanager"]
volumes:
- ./hadoop/config:/opt/hadoop/etc/hadoop
networks:
- hadoop-net
rethinkdb:
image: rethinkdb
ports:
- 8080:8080
- 28015:28015
- 29015:29015
networks:
- rethinkdb-net
spark-builder:
build:
context: ./spark
dockerfile: Dockerfile.builder
volumes:
- ./spark/src:/opt/spark/work-dir/spark-apps
- ./.build:/opt/spark/work-dir/build
spark:
depends_on:
- spark-builder
- namenode
- datanode
image: apache/spark-py
environment:
YARN_CONF_DIR: "/opt/spark/conf/hadoop"
SPARK_CONF_DIR: "/opt/spark/conf/spark"
KAFKA_BOOTSTRAP_SERVERS: "kafka-broker:9092"
KAFKA_TOPIC: "stream-football"
volumes:
- ./.build:/opt/spark/work-dir/python-packages
- ./spark/src:/opt/spark/work-dir/spark-apps/src
- ./spark/main.py:/opt/spark/work-dir/spark-apps/main.py
- ./spark/config:/opt/spark/conf/spark
- ./hadoop/config:/opt/spark/conf/hadoop
ports:
- 4040:4040
command: ["/opt/spark/bin/spark-submit", "spark-apps/main.py"]
networks:
- rethinkdb-net
- hadoop-net
- kafka-net
scraper:
build: ./scraper
env_file:
- ./scraper/.env
depends_on:
- kafka-broker
networks:
- kafka-net
kafka-broker:
image: apache/kafka:3.7.0
ports:
- 9092:9092
- 9093:9093
volumes:
- ./kafka/config:/mnt/shared/config
environment:
CLUSTER_ID: "4L6g3nShT-eMCtK--X86sw"
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: "1@kafka-broker:29093"
KAFKA_LISTENERS: "PLAINTEXT_HOST://:9092,SSL://:9093,CONTROLLER://:29093,PLAINTEXT://:19092"
networks:
- kafka-net
datasets-downloader:
profiles:
- datasets
build: ./data
volumes:
- ./data:/data # Mount host directory `./data` to container's `/data`
- $HOME/.kaggle:/root/.kaggle:ro # Mount Kaggle credentials as read-only
networks:
kafka-net:
driver: bridge
rethinkdb-net:
driver: bridge
hadoop-net:
driver: bridge