-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
128 lines (118 loc) · 3.3 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: "3.8"
services:
mysql:
image: mysql:8.3.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: network
ports:
- "3309:3306"
redis:
image: redis:7-alpine
ports:
- "6379:6379"
zookeeper:
image: "bitnami/zookeeper:3.8.4-debian-12-r8"
ports:
- "2181:2181"
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: "bitnami/kafka:3.7.1-debian-12-r0"
ports:
- "29092:29092"
environment:
- KAFKA_BROKER_ID=2
- KAFKA_CFG_LISTENERS=PLAINTEXT://:29092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:29092
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
depends_on:
- zookeeper
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
container_name: elasticsearch
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms512m -Xmx512m
- xpack.security.enabled=true
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=admin
ports:
- 9200:9200 # for REST API access
# - 9300:9300 # for inter-node communication
volumes:
- esdata:/usr/share/elasticsearch/data
http:
build:
context: .
dockerfile: http_gateway/Dockerfile
ports:
- "8080:8080"
depends_on:
- newsfeed
- post
- user
- message
- mysql
- redis
- kafka
environment:
- USER_URL=user:5610
- NEWSFEED_URL=newsfeed:5612
- POST_URL=post:5611
message:
build:
context: .
dockerfile: message-service/Dockerfile
ports:
- "8081:8081"
newsfeed:
build:
context: .
dockerfile: newsfeed-service/Dockerfile
ports:
- "5612:5612"
environment:
- DATABASE_URL=root:root@tcp(mysql:3306)/network?parseTime=true
- KAFKA_BROKER=kafka:29092
- NEWSFEED_URL=newsfeed:5612
- USER_URL=user:5610
- REDIS_URL=redis:6379
depends_on:
- mysql
- kafka
post:
build:
context: .
dockerfile: post-service/Dockerfile
ports:
- "5611:5611"
environment:
- DATABASE_URL=root:root@tcp(mysql:3306)/network?parseTime=true
- KAFKA_BROKER=kafka:29092
- POST_URL=post:5611
depends_on:
- mysql
- kafka
- redis
user:
build:
context: .
dockerfile: user-service/Dockerfile
ports:
- "5610:5610"
environment:
- DATABASE_URL=root:root@tcp(mysql:3306)/network?parseTime=true
- USER_URL=user:5610
- REDIS_URL=redis:6379
- ELASTIC_SEARCH_URL=http://elasticsearch:9200
- ELASTICSEARCH_USERNAME=elastic
- ELASTICSEARCH_PASSWORD=admin
depends_on:
- mysql
- redis
- elasticsearch
volumes:
esdata:
driver: local