-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
82 lines (76 loc) · 2.18 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
version: "3.9"
services:
postgres:
image: postgres:15
container_name: postgres_container
environment:
POSTGRES_USER: abc
POSTGRES_PASSWORD: abc
POSTGRES_DB: proj
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
mongo:
image: mongo:6
container_name: mongo_container
environment:
MONGO_INITDB_ROOT_USERNAME: abc
MONGO_INITDB_ROOT_PASSWORD: abc
MONGO_INITDB_DATABASE: chat_db # Optional: Automatically create a default database
ports:
- "27017:27017" # Expose MongoDB on the host machine's port 27017
volumes:
- mongo_data:/data/db # Persistent storage for MongoDB data across restarts
redis:
image: redis:7
container_name: redis_container
ports:
- "6379:6379" # Expose Redis on the host machine's port 6379
command: redis-server --appendonly yes # Enable persistence for Redis
volumes:
- redis_data:/data/redis # Persistent storage for Redis data across restarts
kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CREATE_TOPICS: "notifications:1:1"
ports:
- "9092:9092"
zookeeper:
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
backend:
image: backend # comment this entire thing incase of local development
container_name: backend
environment:
MONGO_URL: mongodb://abc:abc@mongo_container:27017/chat_db?authSource=admin
POSTGRES_URL: postgresql+asyncpg://abc:abc@postgres_container:5432/proj
REDIS_URL: redis://redis:6379/0
KAFKA_BROKER: kafka:9092
ports:
- "6767:6767"
depends_on:
- mongo
- postgres
- redis
- kafka
volumes:
postgres_data:
mongo_data:
redis_data:
networks:
default:
name: my_network