-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.elastic.yml
More file actions
104 lines (97 loc) · 2.93 KB
/
Copy pathdocker-compose.elastic.yml
File metadata and controls
104 lines (97 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# docker-compose.elastic.yml
# M4 Elastic Workers Demo
# Usage: docker compose -f docker-compose.elastic.yml up -d
services:
nats:
image: nats:2.10-alpine
command: ["--jetstream", "--store_dir=/data", "--http_port=8222"]
ports:
- "4222:4222"
- "8222:8222"
healthcheck:
test: ["CMD", "sh", "-c", "wget -qO- http://localhost:8222/healthz > /dev/null 2>&1"]
interval: 2s
timeout: 2s
retries: 5
start_period: 2s
redis:
image: docker.dragonflydb.io/dragonflydb/dragonfly
command: ["--logtostderr"]
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 2s
retries: 5
start_period: 2s
dispatcher:
build: { context: ., target: dispatcher }
depends_on:
nats: { condition: service_healthy }
redis: { condition: service_healthy }
manager: { condition: service_healthy }
environment:
LABIOS_NATS_URL: "nats://nats:4222"
LABIOS_REDIS_HOST: "redis"
LABIOS_SCHEDULER_POLICY: "${LABIOS_SCHEDULER_POLICY:-round-robin}"
LABIOS_SCHEDULER_PROFILE: "${LABIOS_SCHEDULER_PROFILE:-}"
healthcheck:
test: ["CMD-SHELL", "test -f /tmp/labios-ready"]
interval: 2s
retries: 10
start_period: 3s
worker-1:
image: labios-worker:latest
build: { context: ., target: worker }
depends_on:
nats: { condition: service_healthy }
redis: { condition: service_healthy }
manager: { condition: service_healthy }
environment:
LABIOS_NATS_URL: "nats://nats:4222"
LABIOS_REDIS_HOST: "redis"
LABIOS_WORKER_ID: "1"
LABIOS_WORKER_SPEED: "5"
LABIOS_WORKER_ENERGY: "1"
LABIOS_WORKER_CAPACITY: "10GB"
LABIOS_WORKER_IDLE_TIMEOUT_MS: "15000"
volumes:
- worker-1-data:/labios/data
healthcheck:
test: ["CMD-SHELL", "test -f /tmp/labios-ready"]
interval: 2s
retries: 10
start_period: 3s
manager:
build: { context: ., target: manager }
depends_on:
nats: { condition: service_healthy }
redis: { condition: service_healthy }
environment:
LABIOS_NATS_URL: "nats://nats:4222"
LABIOS_REDIS_HOST: "redis"
LABIOS_ELASTIC_ENABLED: "true"
LABIOS_ELASTIC_MIN_WORKERS: "1"
LABIOS_ELASTIC_MAX_WORKERS: "3"
LABIOS_DOCKER_IMAGE: "labios-worker"
LABIOS_DOCKER_NETWORK: "labios_default"
LABIOS_WORKER_IDLE_TIMEOUT_MS: "15000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
healthcheck:
test: ["CMD-SHELL", "test -f /tmp/labios-ready"]
interval: 2s
retries: 10
start_period: 3s
test:
build: { context: ., target: test }
depends_on:
dispatcher: { condition: service_healthy }
worker-1: { condition: service_healthy }
manager: { condition: service_healthy }
environment:
LABIOS_NATS_URL: "nats://nats:4222"
LABIOS_REDIS_HOST: "redis"
volumes:
worker-1-data: