Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (73 loc) · 2.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
77 lines (73 loc) · 2.19 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
volumes:
postgres_main-db_data:
postgres_stats-db_data:
kafka_data:
kafka_secrets:
kafka_init_data:
kafka_init_secrets:
services:
main-db:
image: postgres:16.1
container_name: ewm-main-db
ports:
- "6541:5432"
environment:
- POSTGRES_DB=ewm-main
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=12345
volumes:
- ./docker-init-core.sql:/docker-entrypoint-initdb.d/docker-init-core.sql:ro
- postgres_main-db_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U dbuser -d ewm-main" ]
interval: 5s
timeout: 5s
retries: 10
stats-db:
image: postgres:16.1
container_name: ewm-stats-db
ports:
- "6542:5432"
environment:
- POSTGRES_DB=ewm-stats
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=12345
volumes:
- ./docker-init-stats.sql:/docker-entrypoint-initdb.d/docker-init-stats.sql:ro
- postgres_stats-db_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER
timeout: 5s
interval: 5s
retries: 10
kafka:
image: confluentinc/confluent-local:7.4.3
hostname: kafka
container_name: kafka
volumes:
- kafka_data:/var/lib/kafka/data
- kafka_secrets:/etc/kafka/secrets
ports:
- "9092:9092" # for client connections
- "9101:9101" # JMX
restart: unless-stopped
environment:
KAFKA_NODE_ID: 1
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092'
KAFKA_JMX_PORT: 9101
KAFKA_JMX_HOSTNAME: localhost
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092'
CLUSTER_ID: 'K0EA9p0yEe6MkAAAAkKsEg'
kafka-init-topics:
image: confluentinc/confluent-local:7.4.3
container_name: kafka-init-topics
volumes:
- kafka_init_data:/var/lib/kafka/data
- kafka_init_secrets:/etc/kafka/secrets
- ./docker-init-topics.sh:/docker-init-topics.sh:ro
depends_on:
- kafka
command: ["bash", "/docker-init-topics.sh"]
init: true