-
Notifications
You must be signed in to change notification settings - Fork 149
/
docker-compose.infrastructure.yaml
275 lines (257 loc) · 9.19 KB
/
docker-compose.infrastructure.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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
version: "3.8"
name: food-delivery-microservices
services:
#######################################################
# rabbitmq
#######################################################
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
restart: on-failure
ports:
- ${RABBITMQ_HOST_PORT:-5672}:${RABBITMQ_PORT:-5672}
- ${RABBITMQ_HOST_API_PORT:-15672}:${RABBITMQ_API_PORT:-15672}
# volumes:
# - rabbitmq:/var/lib/rabbitmq
networks:
- food-delivery
#######################################################
# mongo
#######################################################
mongo:
image: mongo:latest
container_name: mongo
restart: on-failure
# https://docs.docker.com/compose/environment-variables/env-file/#parameter-expansion
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER:-admin}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASS:-admin}
ports:
- ${MONGO_HOST_PORT:-27017}:${MONGO_PORT:-27017}
networks:
- food-delivery
#######################################################
# postgres
#######################################################
postgres:
image: postgres:latest
container_name: postgres
restart: on-failure
ports:
- ${POSTGRES_HOST_PORT:-5432}:${POSTGRES_PORT:-5432}
#https://docs.docker.com/compose/environment-variables/env-file/#parameter-expansion
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
networks:
- food-delivery
# #######################################################
# # eventstore-db
# #######################################################
# # https://developers.eventstore.com/server/v21.10/installation.html#insecure-single-node
# # https://hub.docker.com/r/eventstore/eventstore/tags
# # https://stackoverflow.com/questions/65272764/ports-are-not-available-listen-tcp-0-0-0-0-50070-bind-an-attempt-was-made-to
# # EVENTSTORE_MEM_DB=true, it tells the EventStoreDB container to use an in-memory database, which means that any data stored in EventStoreDB will not be persisted between container restarts. Once the container is stopped or restarted, all data will be lost.
# eventstore:
# image: eventstore/eventstore:latest
# container_name: eventstore
# restart: on-failure
# environment:
# - EVENTSTORE_CLUSTER_SIZE=1
# - EVENTSTORE_RUN_PROJECTIONS=All
# - EVENTSTORE_START_STANDARD_PROJECTIONS=false
# - EVENTSTORE_EXT_TCP_PORT=1113
# - EVENTSTORE_HTTP_PORT=2113
# - EVENTSTORE_INSECURE=true
# - EVENTSTORE_ENABLE_EXTERNAL_TCP=true
# - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
# - EVENTSTORE_MEM_DB=true
# ports:
# - "1113:1113"
# - ${EVENTSTORE_HOST_PORT:-2113}:${EVENTSTORE_PORT:-2113}
# volumes:
# - type: volume
# source: eventstore-volume-data
# target: /var/lib/eventstore
# - type: volume
# source: eventstore-volume-logs
# target: /var/log/eventstore
# networks:
# - food-delivery
# #######################################################
# # Redis
# #######################################################
## https://developer.redis.com/howtos/quick-start
## redis-stack is a image with redis modules enabled like JSON module
# redis:
# image: redis/redis-stack:latest
# container_name: redis
# restart: unless-stopped
# networks:
# - food-delivery
# ports:
# - 6379:6379
# #######################################################
# # Portainer
# #######################################################
# # https://bobcares.com/blog/install-portainer-docker-compose/
# portainer:
# image: portainer/portainer-ce:latest
# container_name: portainer
# restart: unless-stopped
# security_opt:
# - no-new-privileges:true
# volumes:
# - /etc/localtime:/etc/localtime:ro
# - /var/run/docker.sock:/var/run/docker.sock:ro
# - ./portainer-data:/data
# ports:
# - 9000:9000
# networks:
# - food-delivery
# #######################################################
# # elasticsearch
# #######################################################
# elasticsearch:
# container_name: elastic_search
# restart: on-failure
# image: elasticsearch:8.13.1
# environment:
# - discovery.type=single-node
# - bootstrap.memory_lock=true
# - xpack.monitoring.enabled=true
# - xpack.watcher.enabled=false
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
# ulimits:
# memlock:
# soft: -1
# hard: -1
# volumes:
# - elastic-data:/usr/share/elasticsearch/data
# ports:
# - ${ELASTIC_HOST_PORT:-9200}:${ELASTIC_PORT:-9200}
# - 9300:9300
# networks:
# - food-delivery
# #######################################################
# # kibana
# #######################################################
# kibana:
# image: kibana:8.13.1
# container_name: kibana
# restart: on-failure
# environment:
# - ELASTICSEARCH_HOSTS=http://elastic_search:9200
# ports:
# - ${KIBANA_HOST_PORT:-5601}:${KIBANA_PORT:-5601}
# networks:
# - food-delivery
# depends_on:
# - elasticsearch
# jaeger:
# container_name: jaeger
# restart: on-failure
# image: jaegertracing/all-in-one:latest
# ports:
# - "16686:16686"
# - "14268:14268"
# - "14250:14250"
# networks:
# - food-delivery
# #######################################################
# # zipkin
# #######################################################
# zipkin:
# image: openzipkin/zipkin:latest
# restart: on-failure
# container_name: zipkin
# ports:
# - "9411:9411"
# networks:
# - food-delivery
# #######################################################
# # otel-collector
# #######################################################
# otel-collector:
# image: otel/opentelemetry-collector-contrib-dev:latest
# command: ["--config=/etc/otel-collector-config.yaml", ""]
# volumes:
# - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
# ports:
# - "1888:1888" # pprof extension
# - "8888:8888" # Prometheus metrics exposed by the collector
# - "8889:8889" # Prometheus exporter metrics
# - "13133:13133" # health_check extension
# - "4317:4317" # OTLP gRPC receiver
# - "55679:55679" # zpages extension
# depends_on:
# - jaeger
# - zipkin
# networks:
# - food-delivery
# #######################################################
# # prometheus
# #######################################################
# prometheus:
# image: prom/prometheus:latest
# container_name: prometheus
# restart: on-failure
# user: root
# ports:
# - ${PROMETHEUS_HOST_PORT:-9090}:${PROMETHEUS_PORT:-9090}
# command:
# - --config.file=/etc/prometheus/prometheus.yml
# volumes:
# - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
# networks:
# - food-delivery
# #######################################################
# # node_exporter
# #######################################################
# node_exporter:
# container_name: node_exporter
# restart: on-failure
# image: prom/node-exporter
# ports:
# - "9101:9100"
# networks:
# - food-delivery
# #######################################################
# # grafana
# #######################################################
# grafana:
# container_name: grafana
# restart: on-failure
# image: grafana/grafana:latest
# ports:
# - ${GRAFANA_HOST_PORT:-3000}:${GRAFANA_PORT:-3000}
# networks:
# - food-delivery
# #######################################################
# # seq
# #######################################################
# seq:
# image: datalust/seq:latest
# container_name: seq
# restart: on-failure
# ports:
# - 8081:80
# - 5341:5341
# environment:
# ACCEPT_EULA: Y
# networks:
# - food-delivery
# https://docs.docker.com/compose/networking/
# https://docs.docker.com/engine/reference/commandline/network_create/
# https://docs.docker.com/compose/compose-file/#networks-top-level-element
# https://stackoverflow.com/questions/38088279/communication-between-multiple-docker-compose-projects
# We could use also a predefined network and connect to that predefined network with specifying the 'name' of existing network and set 'external' attribute to true
# When we run docker-compose up, Docker Compose will check if the 'food-delivery' network already exists. If it does not exist, it will create the 'food-delivery' network. If it exists, it will use the existing 'food-delivery' network. problem is that if we do a docker-compose down this network will delete and other docker-compose that use same network will fail because network deleted so its better we use `external` keyword for using a predefined network
networks:
food-delivery:
name: food-delivery
driver: bridge
volumes:
eventstore-volume-data:
eventstore-volume-logs:
elastic-data: