-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
111 lines (96 loc) · 2.79 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
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
105
106
107
108
109
110
version: '3'
networks:
kafkastack-network:
volumes:
datavolume:
driver: local
driver_opts:
type: none
o: bind
device: ./datavolume
# EXAMPLE of mapping another subdir. Each subdir is done with its own volume alias.
# zoovolumefoo:
# driver: local
# driver_opts:
# type: none
# o: bind
# device: ./zoovolume/foo
zoovolumedata:
driver: local
driver_opts:
type: none
o: bind
device: ./zoovolume/data
kafkavolume:
driver: local
driver_opts:
type: none
o: bind
device: ./kafkavolume
services:
# ---- ZOOKEEPER ----
kafkastack-zookeeper:
image: wurstmeister/zookeeper
container_name: kafkastack-zookeeper
# build: ./zookeeper # Future custom build, Dockerfile
networks:
- kafkastack-network
ports:
- "2181:2181"
volumes:
# - zoovolumeconf:/opt/zookeeper-3.4.13/foo # EXAMPLE. See comments above near volumes.
- zoovolumedata:/opt/zookeeper-3.4.13/data
# ---- KAFKA ----
kafkastack-kafka:
image: wurstmeister/kafka
container_name: kafkastack-kafka
# build: ./kafka # Future custom build, Dockerfile
# WHAT DEPENDS ON WHAT FIRST? zookeeper or kafka??
# I think ZooKeeper has to be up first.
# depends_on:
# - kafkastack-zookeeper
environment:
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ZOOKEEPER_CONNECT: kafkastack-zookeeper:2181
networks:
- kafkastack-network
ports:
- "9092:9092"
volumes:
- kafkavolume:/kafka
# ---- NODE KAFKA CLIENT ----
kafkastack-node:
container_name: kafkastack-node
build: ./node
depends_on:
- kafkastack-kafka
# SETUP: To use a full repository URL image name, customize a URL like the one here:
# image: <YOUR-AWS-USER-ID-NUMBER>.dkr.ecr.us-west-2.amazonaws.com/<YOUR-AWS-REPO-NAME>:kafkastack-kafka
image: kafkastack-node
# environment:
# KAFKA_ADVERTISED_HOST_NAME: localhost
# KAFKA_ZOOKEEPER_CONNECT: kafkastack-zookeeper:2181
networks:
- kafkastack-network
# Later we may have a port listening for WS connections from the react app. Proposed: 44555
# ports:
# - "44555:44555"
volumes:
- datavolume:/app/datavolume
# wait-for-it.sh must target the internal port number, not the external
command: [
"/app/wait-for-it.sh",
"--host=kafkastack-kafka",
"--port=9092",
"--timeout=20",
"--",
"/usr/local/bin/node",
"/app/src/index.js",
]
# Entrypoint command options:
# /app/src/index.js
# /app/src/producerBasic.js
# /app/src/consumerBasic.js
######################################################################################################################
# https://hub.docker.com/r/wurstmeister/kafka
# https://hub.docker.com/r/wurstmeister/zookeeper/