mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
97 lines
2.5 KiB
Go
97 lines
2.5 KiB
Go
version: "3.3"
|
|
services:
|
|
|
|
master:
|
|
build:
|
|
context: dockerfiles/golang
|
|
command: "air -c .air.conf"
|
|
volumes:
|
|
- ../backend:/backend
|
|
- ./log/master.log:/tmp/air.log
|
|
depends_on:
|
|
- mongo
|
|
- redis
|
|
ports:
|
|
- 8000:8000
|
|
environment:
|
|
CRAWLAB_MONGO_HOST: "mongo"
|
|
CRAWLAB_REDIS_ADDRESS: "redis"
|
|
CRAWLAB_SERVER_MASTER: "Y"
|
|
CRAWLAB_SERVER_REGISTER_TYPE: "customName"
|
|
CRAWLAB_SERVER_REGISTER_CUSTOMNODENAME: "master_1"
|
|
CRAWLAB_SERVER_PORT: 8000
|
|
worker-1:
|
|
build:
|
|
context: dockerfiles/golang
|
|
command: "air -c .air.conf"
|
|
depends_on:
|
|
- mongo
|
|
- redis
|
|
|
|
ports:
|
|
- 8001:8000
|
|
volumes:
|
|
- ../backend:/backend
|
|
- ./log/worker-1.log:/tmp/air.log
|
|
environment:
|
|
CRAWLAB_MONGO_HOST: "mongo"
|
|
CRAWLAB_REDIS_ADDRESS: "redis"
|
|
CRAWLAB_SERVER_MASTER: "N"
|
|
CRAWLAB_SERVER_PORT: 8001
|
|
CRAWLAB_SERVER_REGISTER_TYPE: "customName"
|
|
CRAWLAB_SERVER_REGISTER_CUSTOMNODENAME: "worker_1"
|
|
worker-2:
|
|
build:
|
|
context: dockerfiles/golang
|
|
command: "air -c .air.conf"
|
|
# volumes:
|
|
# - ../backend:/backend
|
|
# - ./log/master.log:/tmp/air.log
|
|
depends_on:
|
|
- mongo
|
|
- redis
|
|
ports:
|
|
- 8002:8000
|
|
volumes:
|
|
- ../backend:/backend
|
|
- ./log/worker-2.log:/tmp/air.log
|
|
environment:
|
|
CRAWLAB_MONGO_HOST: "mongo"
|
|
CRAWLAB_REDIS_ADDRESS: "redis"
|
|
CRAWLAB_SERVER_MASTER: "N"
|
|
CRAWLAB_SERVER_PORT: 8002
|
|
CRAWLAB_SERVER_REGISTER_TYPE: "customName"
|
|
CRAWLAB_SERVER_REGISTER_CUSTOMNODENAME: "worker_2"
|
|
frontend:
|
|
build:
|
|
context: ./dockerfiles/node
|
|
args:
|
|
- NPM_REGISTRY="http://registry.npm.taobao.org/"
|
|
container_name: crawlab_frontend
|
|
ports:
|
|
- 8080:8080
|
|
volumes:
|
|
- ../frontend:/frontend
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
yarn install
|
|
yarn run serve
|
|
depends_on:
|
|
- master
|
|
mongo:
|
|
image: mongo:latest
|
|
restart: always
|
|
# volumes:
|
|
# - "/opt/crawlab/mongo/data/db:/data/db" # make data persistent 持久化
|
|
ports:
|
|
- "27017:27017" # expose port to host machine 暴露接口到宿主机
|
|
redis:
|
|
image: redis:latest
|
|
restart: always
|
|
# command: redis-server --requirepass "password" # set redis password 设置 Redis 密码
|
|
# volumes:
|
|
# - "/opt/crawlab/redis/data:/data" # make data persistent 持久化
|
|
ports:
|
|
- "6379:6379" # expose port to host machine 暴露接口到宿主机 |