feat: add Docker Compose configuration for testing environment

This commit is contained in:
Marvin Zhang
2025-02-15 21:23:52 +08:00
parent 67181700c8
commit 9ff4d818c4
2 changed files with 62 additions and 0 deletions

2
docker/test/.env Normal file
View File

@@ -0,0 +1,2 @@
CRAWLAB_LICENSE=eyJhbGciOiJIUzI1NiJ9.eyJjcmVhdGVkX2F0IjoxNzAwMzA3MjkyLCJ1c2VybmFtZSI6InRpa2F6eXFAMTYzLmNvbSJ9.NSQAMBWdIGlVDFguxfe2wWsTeEprUx5nN2lw3LF107c
MONGO_PORT=29017

View File

@@ -0,0 +1,60 @@
services:
master:
build: .
image: crawlabteam/crawlab:${CRAWLAB_VERSION:-develop}
container_name: crawlab_test_master
environment:
CRAWLAB_NODE_NAME: "Master Node"
CRAWLAB_NODE_MASTER: "Y"
CRAWLAB_MONGO_HOST: "mongo"
CRAWLAB_MONGO_PORT: "27017"
CRAWLAB_MONGO_DB: "crawlab"
CRAWLAB_MONGO_USERNAME: "dev_user"
CRAWLAB_MONGO_PASSWORD: "dev_password"
CRAWLAB_MONGO_AUTHSOURCE: "admin"
CRAWLAB_PPROF: "true"
CRAWLAB_LOG_LEVEL: "debug"
ports:
- "8080:8080"
- "6060:6060"
depends_on:
- mongo
env_file:
- .env
worker-01:
build: .
image: crawlabteam/crawlab:${CRAWLAB_VERSION:-develop}
container_name: crawlab_test_worker_01
environment:
CRAWLAB_NODE_NAME: "Worker Node 01"
CRAWLAB_NODE_MASTER: "N"
CRAWLAB_MASTER_HOST: "master"
depends_on:
- master
env_file:
- .env
worker-02:
build: .
image: crawlabteam/crawlab:${CRAWLAB_VERSION:-develop}
container_name: crawlab_test_worker_02
environment:
CRAWLAB_NODE_NAME: "Worker Node 02"
CRAWLAB_NODE_MASTER: "N"
CRAWLAB_MASTER_HOST: "master"
depends_on:
- master
env_file:
- .env
mongo:
image: mongo:5
container_name: crawlab_test_mongo
environment:
MONGO_INITDB_ROOT_USERNAME: "dev_user"
MONGO_INITDB_ROOT_PASSWORD: "dev_password"
ports:
- "${MONGO_PORT:-27017}:27017"
env_file:
- .env