-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
117 lines (106 loc) · 2.45 KB
/
docker-compose.yaml
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
111
112
113
114
version: "3.9"
networks:
bridge:
driver: bridge
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
networks:
bridge:
aliases:
- zookeeper
kafka:
image: confluentinc/cp-kafka
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ADVERTISED_HOST_NAME: 0.0.0.0
KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
JMX_PORT: 9999
networks:
bridge:
aliases:
- kafka
kafka-producer:
build:
context: ./docker/kafka-producer
container_name: kafka-producer
depends_on:
- kafka
- postgres
- kafka-consumer
environment:
KAFKA_SERVER: "kafka:9092"
ZOOKEEPER_SERVER: "zookeeper:32181"
PRODUCER_INTERVAL: 100
networks:
- bridge
kafka-consumer:
build:
context: ./docker/kafka-consumer
container_name: kafka-consumer
depends_on:
- kafka
- postgres
environment:
KAFKA_SERVER: "kafka:9092"
ZOOKEEPER_SERVER: "zookeeper:32181"
PRODUCER_INTERVAL: 100
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}
networks:
- bridge
postgres:
build:
context: ./docker/postgres
container_name: postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
logging:
options:
max-size: 10m
max-file: "3"
ports:
- 5438:5432
networks:
- bridge
pgadmin:
image: dpage/pgadmin4:latest
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "5000:80"
depends_on:
- postgres
networks:
- bridge
ui:
build:
context: ./docker/ui
container_name: ui
restart: always
ports:
- "8501:8501"
environment:
DB_NAME: postgres
DB_USER: postgres
DB_PASSWORD: postgres
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}
depends_on:
- postgres
networks:
- bridge
volumes:
settings:
data: