-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
103 lines (97 loc) · 2.63 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
services:
# # Message Broker for real-time data processing
# zookeeper:
# image: confluentinc/cp-zookeeper:latest
# container_name: activity-zookeeper
# environment:
# ZOOKEEPER_CLIENT_PORT: 2181
# ZOOKEEPER_TICK_TIME: 2000
# ports:
# - "2181:2181"
# networks:
# - activity-network
# healthcheck:
# test: ["CMD-SHELL", "echo srvr | nc localhost 2181 || exit 1"]
# interval: 10s
# timeout: 5s
# retries: 5
# kafka:
# image: confluentinc/cp-kafka:latest
# container_name: activity-kafka
# depends_on:
# zookeeper:
# condition: service_healthy
# ports:
# - "9092:9092"
# - "29092:29092"
# environment:
# KAFKA_BROKER_ID: 1
# KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
# KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
# KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:29092,EXTERNAL://localhost:9092
# KAFKA_LISTENERS: INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092
# KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
# networks:
# - activity-network
# healthcheck:
# test:
# ["CMD-SHELL", "kafka-topics.sh --bootstrap-server kafka:29092 --list"]
# interval: 10s
# timeout: 5s
# retries: 5
# Database for storing activity data
postgres:
image: postgres:latest
container_name: activity-postgres
environment:
POSTGRES_DB: activity_tracker
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- activity-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# Cache for frequently accessed data
redis:
image: redis:latest
container_name: activity-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- activity-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
# Admin tools
# kafka-ui:
# image: provectuslabs/kafka-ui:latest
# container_name: activity-kafka-ui
# depends_on:
# kafka:
# condition: service_healthy
# ports:
# - "8081:8080"
# environment:
# KAFKA_CLUSTERS_0_NAME: local
# KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
# KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
# networks:
# - activity-network
networks:
activity-network:
driver: bridge
volumes:
postgres_data:
redis_data: