diff --git a/README-zh.md b/README-zh.md index adc44b4a..4dc87800 100644 --- a/README-zh.md +++ b/README-zh.md @@ -19,7 +19,7 @@ 2. [直接部署](https://tikazyq.github.io/crawlab/Installation/Direct.md)(了解内核) ### 要求(Docker) -- Docker +- Docker 18.03+ - Redis - MongoDB 3.6+ @@ -48,9 +48,17 @@ docker run -d --rm --name crawlab \ tikazyq/crawlab:0.3.0 ``` +当然也可以用`docker-compose`来一键启动,甚至不用配置MongoDB和Redis数据库。 + +```bash +docker-compose up +``` + +Docker部署的详情,请见[相关文档](https://tikazyq.github.io/crawlab/Installation/Docker.md)。 + ### 直接部署 -请参考文档。 +请参考[相关文档](https://tikazyq.github.io/crawlab/Installation/Direct.md)。 ## 截图 diff --git a/docker-compose.yml b/docker-compose.yml index 15ff8338..8b7019f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,9 @@ version: '3.3' services: master: image: tikazyq/crawlab:latest - container_name: crawlab + container_name: crawlab-master environment: + CRAWLAB_API_ADDRESS: "192.168.99.100:8000" CRAWLAB_SERVER_MASTER: "Y" CRAWLAB_MONGO_HOST: "mongo" CRAWLAB_REDIS_ADDRESS: "redis:6379" @@ -13,6 +14,16 @@ services: depends_on: - mongo - redis + worker: + image: tikazyq/crawlab:latest + container_name: crawlab-worker + environment: + CRAWLAB_SERVER_MASTER: "N" + CRAWLAB_MONGO_HOST: "mongo" + CRAWLAB_REDIS_ADDRESS: "redis:6379" + depends_on: + - mongo + - redis mongo: image: mongo:latest restart: always diff --git a/examples/run_docker_master.sh b/examples/run_docker_master.sh index 531f4dda..a6c18419 100644 --- a/examples/run_docker_master.sh +++ b/examples/run_docker_master.sh @@ -1,4 +1,4 @@ -docker run -d --rm --name crawlab \ +docker run -d --restart always --name crawlab \ -e CRAWLAB_REDIS_ADDRESS=192.168.99.1:6379 \ -e CRAWLAB_MONGO_HOST=192.168.99.1 \ -e CRAWLAB_SERVER_MASTER=Y \ diff --git a/examples/run_docker_worker.sh b/examples/run_docker_worker.sh index 48eab1cc..6592c2d6 100644 --- a/examples/run_docker_worker.sh +++ b/examples/run_docker_worker.sh @@ -1,4 +1,4 @@ -docker run --rm --name crawlab \ +docker run --restart always --name crawlab \ -e CRAWLAB_REDIS_ADDRESS=192.168.99.1:6379 \ -e CRAWLAB_MONGO_HOST=192.168.99.1 \ -e CRAWLAB_SERVER_MASTER=N \