-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
60 lines (58 loc) · 1.44 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
version: '2'
networks:
backend:
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2182:2181" # Host:Container (or just Container)
networks:
- backend
kafka:
image: wurstmeister/kafka
ports:
- "9093:9092"
extra_hosts:
- "custom-localhost:10.106.105.121"
environment:
KAFKA_ADVERTISED_HOST_NAME: custom-localhost # Do not use localhost or 127.0.0.1 if you want to run multiple brokers
# audit-log app will create topic
KAFKA_CREATE_TOPICS: "audit-logging:1:1" # 1 partition and 1 replica
KAFKA_ZOOKEEPER_CONNECT: custom-localhost:2182
depends_on:
- zookeeper
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- backend
# kafka:
# image: spotify/kafka
# ports:
# - "9093:9092"
# extra_hosts:
# - "custom-localhost:10.106.105.121"
# environment:
# ADVERTISED_HOST: custom-localhost
# TOPICS: "audit-logging"
audit-log-app:
restart: always
build: . # current directory contains a Dockerfile
ports:
- "5000:5000"
extra_hosts:
- "custom-localhost:10.106.105.121"
volumes:
- ./logs:/usr/src/app/logs # to persist log files
depends_on:
- kafka
- mongo
networks:
- backend
mongo:
image: mongo
volumes:
- /var/lib/mongodb:/var/lib/mongodb # persistent storage
ports:
- "27018:27017"
networks:
- backend