45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
services:
|
|
crawler:
|
|
container_name: sport-era-crawler
|
|
image: sport-era-crawler:latest
|
|
build:
|
|
context: ${CRAWLER_DIR:-./crawler}
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
env_file:
|
|
- ./.env.docker
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
DQD_CONFIG_PATH: /app/config/settings.yaml
|
|
DQD_TASKS_FILE: /app/config/crawler_tasks.yaml
|
|
DQD_LOCK_DIR: /app/data/locks
|
|
volumes:
|
|
- ${CRAWLER_DIR:-./crawler}/logs:/app/logs
|
|
- ${CRAWLER_DIR:-./crawler}/data:/app/data
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
kb-worker:
|
|
container_name: sport-era-kb-worker
|
|
image: sport-era-crawler:latest
|
|
build:
|
|
context: ${CRAWLER_DIR:-./crawler}
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
# test_sbnews is granted for 127.0.0.1; use host networking so MySQL
|
|
# sees the worker as a local client instead of a Docker bridge address.
|
|
network_mode: host
|
|
env_file:
|
|
- ./.env.docker
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
DQD_CONFIG_PATH: /app/config/settings.yaml
|
|
DQD_DB_HOST: 127.0.0.1
|
|
DQD_REDIS_HOST: 127.0.0.1
|
|
command: ["python", "scripts/kb_worker.py", "--batch=50", "--block-ms=5000", "--max-retries=3"]
|
|
volumes:
|
|
- ${CRAWLER_DIR:-./crawler}/logs:/app/logs
|
|
- ${CRAWLER_DIR:-./crawler}/data:/app/data
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|