-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
178 lines (164 loc) · 3.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
version: "3.7"
services:
#
# Microservices
#
identity:
build: ./identity-service
hostname: identity.alexandria.com
image: alexandria-identity
restart: always
volumes:
- api:/usr/src/identity/
ports:
- "3000:8080"
- "4000:31337"
depends_on:
- kafka
- zipkin
networks:
- alexandria-tier
author:
build: ./author-service
hostname: author.alexandria.com
image: alexandria-author
restart: always
volumes:
- api:/usr/src/author/
ports:
- "3001:8080"
- "4001:31337"
depends_on:
- postgres
- redis
- kafka
- zipkin
networks:
- alexandria-tier
media:
build: ./media-service
hostname: media.alexandria.com
image: alexandria-media
restart: always
volumes:
- api:/usr/src/media/
ports:
- "3002:8080"
- "4002:31337"
depends_on:
- postgres
- redis
- kafka
- zipkin
networks:
- alexandria-tier
blob:
build: ./blob-service
hostname: blob.alexandria.com
image: alexandria-blob
restart: always
volumes:
- api:/usr/src/blob/
ports:
- "3003:8080"
depends_on:
- kafka
- zipkin
networks:
- alexandria-tier
#
# Infrastructure
#
redis:
image: redis:alpine
restart: on-failure
ports:
- "6380:6379"
networks:
- alexandria-tier
postgres:
image: "postgres:12.2-alpine"
restart: on-failure
ports:
- "5431:5432"
environment:
- POSTGRES_MULTIPLE_DATABASES=alexandria_author,alexandria_media
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=root
volumes:
- ./scripts/migrations/:/docker-entrypoint-initdb.d/
networks:
- alexandria-tier
zipkin:
image: "openzipkin/zipkin"
restart: on-failure
ports:
- "9412:9411"
networks:
- alexandria-tier
prometheus:
image: "prom/prometheus"
restart: on-failure
ports:
- 9090:9090
volumes:
- ./third-party/prometheus:/etc/prometheus
networks:
- alexandria-tier
grafana:
image: "grafana/grafana"
depends_on:
- prometheus
- zipkin
- postgres
restart: on-failure
ports:
- "9413:3000"
networks:
- alexandria-tier
zookeeper:
image: "bitnami/zookeeper:latest"
restart: on-failure
ports:
- "2182:2181"
environment:
- ZOO_ENABLE_AUTH=no
- ZOO_SERVER_USERS=kafka
- ZOO_SERVER_PASSWORDS=root
- ALLOW_ANONYMOUS_LOGIN=yes
volumes:
- ./third-party/zookeeper/:/bitnami/zookeeper
networks:
- alexandria-tier
kafka:
image: "bitnami/kafka:latest"
restart: on-failure
depends_on:
- zookeeper
ports:
- "9093:9092"
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,PLAINTEXT_HOST://:29092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
- KAFKA_ZOOKEEPER_USER=kafka
- KAFKA_ZOOKEEPER_PASSWORD=root
- KAFKA_INTER_BROKER_USER=interuser
- KAFKA_INTER_BROKER_PASSWORD=interpassword
- KAFKA_BROKER_USER=user
- KAFKA_BROKER_PASSWORD=password
volumes:
- ./third-party/kafka/:/bitnami/kafka
networks:
- alexandria-tier
volumes:
api:
driver: local
database_postgres:
driver: local
# Networks to be created to facilitate communication between containers
networks:
alexandria-tier:
driver: bridge