-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (93 loc) · 2.52 KB
/
Copy pathdocker-compose.yml
File metadata and controls
100 lines (93 loc) · 2.52 KB
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
services:
api_service:
build: ./api-gateway
environment:
USER_SERVICE_ADDR: user_service:8080
POST_COMMENT_ADDR: post_comment_service:50051
ports:
- "8081:8080"
depends_on:
- user_service
- post_comment_service
user_service:
build: ./user-service
env_file: .env
environment:
DB_DNS: postgresql+asyncpg://postgres:postgres@user_service_db:5432/postgres
ports:
- "8082:8080"
depends_on:
- users_db
kafka-ui:
image: provectuslabs/kafka-ui:latest
ports:
- "8083:8080"
environment:
DYNAMIC_CONFIG_ENABLED: true
depends_on:
- kafka
post_comment_service:
build: ./post-comment-service
environment:
DB_DNS: postgresql+asyncpg://postgres:postgres@post_comment_service_db:5432/postgres
ports:
- "50051:50051"
depends_on:
- posts_db
- kafka
users_db:
image: postgres:16
hostname: user_service_db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 3s
timeout: 3s
retries: 10
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- user_pg_data:/var/lib/postgresql/data
posts_db:
image: postgres:16
hostname: post_comment_service_db
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d postgres" ]
interval: 3s
timeout: 3s
retries: 10
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5433:5432"
volumes:
- post_pg_data:/var/lib/postgresql/data
kafka:
image: confluentinc/cp-kafka:7.5.0
hostname: kafka
ports:
- "9092:9092"
environment:
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /tmp/kraft-combined-logs
CLUSTER_ID: eLt7zL8OSw2ZJYlMBxlW2A
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
volumes:
user_pg_data:
driver: local
post_pg_data:
driver: local