-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
66 lines (64 loc) · 1.81 KB
/
docker-compose.yml
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
version: "3.4"
services:
zookeeper:
image: bitnami/zookeeper:latest
ports:
- 2181:2181
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
logging:
driver: none
kafka:
container_name: kafka
image: &kafka-image bitnami/kafka:latest
ports:
- 9092:9092
environment:
- BITNAMI_DEBUG=true
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
logging:
driver: none
depends_on:
- zookeeper
healthcheck:
test: ["CMD", "kafka-topics.sh", "--bootstrap-server=localhost:9092", "--list"]
start_period: 15s
interval: 10s
retries: 5
init-kafka:
image: *kafka-image
working_dir: /opt/bitnami/kafka/bin
environment:
- BITNAMI_DEBUG=true
depends_on:
kafka:
condition: service_healthy
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
echo 'Creating kafka topics'
kafka-topics.sh --bootstrap-server kafka:9092 --create --if-not-exists --topic san_exporter_test --replication-factor 1 --partitions 1
echo 'Successfully created the following topics:'
kafka-topics.sh --bootstrap-server kafka:9092 --list
"
exporter:
build:
context: .
dockerfile: Dockerfile
args:
NODE_ENV: development
depends_on:
- kafka
- init-kafka
environment:
KAFKA_URL: kafka:9092
ZOOKEEPER_URL: zookeeper:2181
KAFKA_TOPIC: san_exporter_test
ports:
# port for checking health.
- "127.0.0.1:3000:3000"
entrypoint: "/bin/sh"
command: ["-c", "docker/wait_for_services.sh && node examples/send_dates.js && node examples/send_dates_transaction.js"]