1、安装DockerDesktop
Windows系统下,下载并安装DockerDesktop,下载链接:https://www.docker.com/(注:需要在梯子环境下下载)
2、编写并使用Docker-Compose.yml配置文件
新建一个docker-compose.yml配置文件,并复制下面的配置参数到docker-compose.yml中保存。(任选一处路径存放)
version: '3.3'
services:
master:
image: crawlabteam/crawlab:latest
container_name: crawlab_example_master
environment:
CRAWLAB_NODE_MASTER: "Y"
CRAWLAB_MONGO_HOST: "mongo"
volumes:
- "./.crawlab/master:/root/.crawlab"
ports:
- "8080:8080"
depends_on:
- mongo
worker01:
image: crawlabteam/crawlab:latest
container_name: crawlab_example_worker01
environment:
CRAWLAB_NODE_MASTER: "N"
CRAWLAB_GRPC_ADDRESS: "master"
CRAWLAB_FS_FILER_URL: "http://master:8080/api/filer"
volumes:
- "./.crawlab/worker01:/root/.crawlab"
depends_on:
- master
worker02:
image: crawlabteam/crawlab:latest
container_name: crawlab_example_worker02
environment:
CRAWLAB_NODE_MASTER: "N"
CRAWLAB_GRPC_ADDRESS: "master"
CRAWLAB_FS_FILER_URL: "http://master:8080/api/filer"
volumes:
- "./.crawlab/worker02:/root/.crawlab"
depends_on:
- master
mongo:
image: mongo:latest
container_name: crawlab_example_mongo
restart: always
3、运行docker-compose命令
通过cmd进入到docker-compose.yml 所在路径下,输入下列命令,完成镜像和容器的下载与配置。
docker-compose up
4、进入浏览器,输入localhost:8080,进入crawlab的Web登录页
crawlab的web登录页的默认账号:admin,密码:admin。