docker-compose and docker-compose.yml

docker-compose and docker-compose.yml

In the same docker_dir directory, create docker-compose.yml
vi docker-compose.yml, add below, save and exit
1
version: "3.3"
2
services:
3
spark-master:
4
image: spark_lab/spark:latest
5
container_name: spark-master
6
hostname: spark-master
7
ports:
8
- "8080:8080"
9
- "7077:7077"
10
networks:
11
- spark-network
12
environment:
13
- "SPARK_LOCAL_IP=spark-master"
14
- "SPARK_MASTER_PORT=7077"
15
- "SPARK_MASTER_WEBUI_PORT=8080"
16
command: "/start-master.sh"
17
spark-worker:
18
image: spark_lab/spark:latest
19
depends_on:
20
- spark-master
21
ports:
22
- 8080
23
networks:
24
- spark-network
25
environment:
26
- "SPARK_MASTER=spark://spark-master:7077"
27
- "SPARK_WORKER_WEBUI_PORT=8080"
28
command: "/start-worker.sh"
29
networks:
30
spark-network:
31
driver: bridge
32
ipam:
33
driver: default
34
​
Copied!
Last modified 1yr ago
Copy link