forked from aranaea/kafka-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
77 lines (67 loc) · 1.71 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
version: '3'
services:
store:
image: timescale/timescaledb:latest-pg12 # use latest official postgres version
ports:
- "5432:5432"
env_file:
- database.env # configure postgres
volumes:
- ./database-data:/var/lib/postgresql/data/ # persist data even if container shuts down
- ./init.sql:/docker-entrypoint-initdb.d/init.sql # another possible (better?) appraoch is to run migration scripts from the app
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_CREATE_TOPICS: "contracts:1:1, apis:1:1"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
producer:
build:
context: .
dockerfile: ./producer/Dockerfile
env_file:
- producer.env
api_producer:
build:
context: .
dockerfile: ./api_producer/Dockerfile
consumer:
build:
context: .
dockerfile: ./consumer/Dockerfile
env_file:
- consumer.env
api_consumer:
build:
context: .
dockerfile: ./api_consumer/Dockerfile
env_file:
- api_consumer.env
admin:
image: adminer
restart: always
depends_on:
- store
ports:
- 8080:8080
# too bad min refresh interval is 1 min, not suitable for real-time
# metabase:
# image: metabase/metabase
# restart: always
# environment:
# - metabase.env
# ports:
# # <Port exposed>:<Port running inside container>
# - "3000:3000"
# volumes:
# # Volumes where Metabase data will be persisted
# - ./mb-data:/metabase-data
# depends_on:
# - store