-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-jdk-8.yaml
205 lines (193 loc) · 6.71 KB
/
docker-compose-jdk-8.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
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
version: '3.7'
services:
redis:
image: redis:latest
expose:
- 6379
command: redis-server --requirepass redispass
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 30s
retries: 50
restart: always
postgres:
image: postgres:9.6
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
volumes:
- ./db/pg-init-scripts:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "pg_isready", "-U", "airflow" ]
interval: 5s
retries: 5
ports:
- "5432:5432"
airflow-webserver:
image: "${AIRFLOW_IMAGE_NAME}"
build: ./airflow
restart: always
depends_on:
- postgres
- redis
environment:
- LOAD_EX=n
- FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
- EXECUTOR=Celery
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
- REDIS_PASSWORD=redispass
# AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
# _PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:- apache-airflow-providers-apache-spark}
volumes:
- ./dags:/usr/local/airflow/dags
- ./spark/app:/usr/local/spark/app #Spark Scripts (Must be the same path in airflow and Spark Cluster)
- ./spark/resources:/usr/local/spark/resources #Resources folder (Must be the same path in airflow and Spark Cluster)
# Uncomment to include custom plugins
# - ./plugins:/usr/local/airflow/plugins
ports:
- "8080:8080"
command: webserver
healthcheck:
test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-webserver.pid ]"]
interval: 30s
timeout: 30s
retries: 3
airflow-flower:
image: "${AIRFLOW_IMAGE_NAME}"
build: ./airflow
restart: always
depends_on:
- redis
environment:
- EXECUTOR=Celery
- REDIS_PASSWORD=redispass
ports:
- "5555:5555"
command: flower
airflow-scheduler:
image: "${AIRFLOW_IMAGE_NAME}"
build: ./airflow
restart: always
depends_on:
- airflow-webserver
volumes:
- ./dags:/usr/local/airflow/dags
# Uncomment to include custom plugins
# - ./plugins:/usr/local/airflow/plugins
environment:
- LOAD_EX=n
- FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
- EXECUTOR=Celery
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
- REDIS_PASSWORD=redispass
command: scheduler
airflow-worker:
image: "${AIRFLOW_IMAGE_NAME}"
build: ./airflow
restart: always
depends_on:
- airflow-scheduler
volumes:
- ./dags:/usr/local/airflow/dags
# Uncomment to include custom plugins
# - ./plugins:/usr/local/airflow/plugins
environment:
- FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
- EXECUTOR=Celery
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
- REDIS_PASSWORD=redispass
command: worker
spark-master:
image: docker.io/bitnami/spark:3.1.2
user: root # Run container as root container: https://docs.bitnami.com/tutorials/work-with-non-root-containers/
hostname: spark-master
container_name: spark-master
environment:
- SPARK_MODE=master
- SPARK_WORKLOAD=master
- SPARK_LOCAL_IP=spark-master
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
# - SPARK_EXECUTOR_CORES=4
# - SPARK_EXECUTOR_MEMORY=16GB
ports:
- '8181:8080'
- '7077:7077'
volumes:
- ./spark/app:/usr/local/spark/app # Spark scripts folder (Must be the same path in airflow and Spark Cluster)
- ./spark/resources:/usr/local/spark/resources # Resources folder (Must be the same path in airflow and Spark Cluster)
spark-worker:
image: docker.io/bitnami/spark:3.1.2
user: root
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark-master:7077
# - SPARK_WORKER_MEMORY=4G
# - SPARK_WORKER_CORES=6
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
volumes:
- ./spark/app:/usr/local/spark/app # Spark scripts folder (Must be the same path in airflow and Spark Cluster)
- ./spark/resources:/usr/local/spark/resources # Resources folder (Must be the same path in airflow and Spark Cluster)
depends_on:
- spark-master
jupyter:
image: jupyter/pyspark-notebook:spark-3.1.2
ports:
- "8888:8888"
- "4040-4080:4040-4080"
volumes:
- ./jupyter-lab:/home/jovyan/work/notebooks/
- ./spark/resources/data:/home/jovyan/work/data/
- ./spark/resources/jars:/home/jovyan/work/jars/
# web:
# build: .
# command: python manage.py runserver 0.0.0.0:8000
# volumes:
# - .:/code
# ports:
# - "8000:8000"
# env_file:
# - .env
# depends_on:
# - postgres
#
# zookeeper:
# image: wurstmeister/zookeeper
# # container_name: zookeeper
# ports:
# - "2181:2181"
#
# kafka:
# image: wurstmeister/kafka
# # container_name: kafka
# ports:
# - "9092:9092"
# expose:
# - "9093"
# 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_CREATE_TOPICS: 'test_topic_1'
# KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# depends_on:
# - zookeeper
#volumes:
# postgres-db-volume: