54 lines
2.0 KiB
YAML
54 lines
2.0 KiB
YAML
name: dht-search-cluster
|
|
|
|
services:
|
|
coordinator:
|
|
image: ${DHT_CLUSTER_IMAGE:-dht-search:cluster-dev}
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
init: true
|
|
command: ["--config", "/dht-search/config.toml", "--role", "coordinator", "--http-listen", "0.0.0.0:8080", "--web-dir", "/dht-search/web", "--ingest-listen", "0.0.0.0:8081"]
|
|
environment:
|
|
DHT_SEARCH_CLUSTER_TOKEN: ${DHT_SEARCH_CLUSTER_TOKEN:?请设置至少三十二个字符的集群令牌}
|
|
ports:
|
|
- "127.0.0.1:18080:8080/tcp"
|
|
volumes:
|
|
- ./config.toml:/dht-search/config.toml
|
|
- cluster-coordinator-data:/dht-search/data
|
|
restart: unless-stopped
|
|
|
|
collector-a:
|
|
image: ${DHT_CLUSTER_IMAGE:-dht-search:cluster-dev}
|
|
init: true
|
|
command: ["--config", "/dht-search/config.toml", "--role", "collector", "--coordinator-url", "http://coordinator:8081", "--collector-name", "采集器 A", "--collector-state-dir", "/dht-search/collector", "--no-file-logging"]
|
|
environment:
|
|
DHT_SEARCH_CLUSTER_TOKEN: ${DHT_SEARCH_CLUSTER_TOKEN:?请设置至少三十二个字符的集群令牌}
|
|
ports:
|
|
- "12314:12313/udp"
|
|
volumes:
|
|
- ./config.toml:/dht-search/config.toml:ro
|
|
- cluster-collector-a:/dht-search/collector
|
|
depends_on:
|
|
- coordinator
|
|
restart: unless-stopped
|
|
|
|
collector-b:
|
|
image: ${DHT_CLUSTER_IMAGE:-dht-search:cluster-dev}
|
|
init: true
|
|
command: ["--config", "/dht-search/config.toml", "--role", "collector", "--coordinator-url", "http://coordinator:8081", "--collector-name", "采集器 B", "--collector-state-dir", "/dht-search/collector", "--no-file-logging"]
|
|
environment:
|
|
DHT_SEARCH_CLUSTER_TOKEN: ${DHT_SEARCH_CLUSTER_TOKEN:?请设置至少三十二个字符的集群令牌}
|
|
ports:
|
|
- "12315:12313/udp"
|
|
volumes:
|
|
- ./config.toml:/dht-search/config.toml:ro
|
|
- cluster-collector-b:/dht-search/collector
|
|
depends_on:
|
|
- coordinator
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
cluster-coordinator-data:
|
|
cluster-collector-a:
|
|
cluster-collector-b:
|