1+ version : " 3"
2+
3+ services :
4+ app :
5+ build : .
6+ volumes :
7+ - .:/go/src/
8+
9+ db :
10+ image : postgres:9.4
11+ restart : always
12+ tty : true
13+ volumes :
14+ - .pgdata:/var/lib/postgresql/data
15+ environment :
16+ - POSTGRES_PASSWORD=root
17+ - POSTGRES_DB=codepix
18+ ports :
19+ - " 5432:5432"
20+
21+ zookeeper :
22+ image : confluentinc/cp-zookeeper:latest
23+ environment :
24+ ZOOKEEPER_CLIENT_PORT : 2181
25+
26+ kafka :
27+ image : confluentinc/cp-kafka:latest
28+ depends_on :
29+ - zookeeper
30+ ports :
31+ - " 9092:9092"
32+ - " 9094:9094"
33+ environment :
34+ KAFKA_BROKER_ID : 1
35+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR : 1
36+ KAFKA_ZOOKEEPER_CONNECT : zookeeper:2181
37+ KAFKA_INTER_BROKER_LISTENER_NAME : INTERNAL
38+ KAFKA_LISTENERS : INTERNAL://:9092,OUTSIDE://:9094
39+ KAFKA_ADVERTISED_LISTENERS : INTERNAL://kafka:9092,OUTSIDE://host.docker.internal:9094
40+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP : INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
41+ extra_hosts :
42+ - " host.docker.internal:172.17.0.1"
43+
44+ kafka-topics-generator :
45+ image : confluentinc/cp-kafka:latest
46+ depends_on :
47+ - kafka
48+ command : >
49+ bash -c
50+ "sleep 5s &&
51+ kafka-topics --create --topic=transactions --if-not-exists --bootstrap-server=kafka:9092 &&
52+ kafka-topics --create --topic=transaction-confirmation --if-not-exists --bootstrap-server=kafka:9092 &&
53+ kafka-topics --create --topic=bank001 --if-not-exists --bootstrap-server=kafka:9092 &&
54+ kafka-topics --create --topic=bank002 --if-not-exists --bootstrap-server=kafka:9092"
55+ extra_hosts :
56+ - " host.docker.internal:172.17.0.1"
57+
58+ control-center :
59+ image : confluentinc/cp-enterprise-control-center:6.0.1
60+ hostname : control-center
61+ depends_on :
62+ - kafka
63+ ports :
64+ - " 9021:9021"
65+ environment :
66+ CONTROL_CENTER_BOOTSTRAP_SERVERS : ' kafka:9092'
67+ CONTROL_CENTER_REPLICATION_FACTOR : 1
68+ PORT : 9021
69+
70+ pgadmin :
71+ image : dpage/pgadmin4
72+ tty : true
73+ environment :
74+ - PGADMIN_DEFAULT_EMAIL=admin@user.com
75+ - PGADMIN_DEFAULT_PASSWORD=123456
76+ ports :
77+ - " 9000:80"
78+ depends_on :
79+ - db
0 commit comments