-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
165 lines (152 loc) · 4.22 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
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
version: '3.8'
services:
location-build:
image: location-build:develop
build:
context: "."
dockerfile: ".docker/location/build.Dockerfile"
location:
build:
context: "."
dockerfile: ".docker/location/app.Dockerfile"
# restart: unless-stopped
depends_on:
location-build:
condition: service_completed_successfully
postgresql:
condition: service_healthy
volumes:
- './.env:/location/.env'
- './migrations/location/:/location/migrations/location/'
ports:
- ${LOCATION_PORT}:${LOCATION_PORT}
driver-build:
image: driver-build:develop
build:
context: "."
dockerfile: ".docker/driver/build.Dockerfile"
driver:
build:
context: "."
dockerfile: ".docker/driver/app.Dockerfile"
# restart: unless-stopped
depends_on:
location-build:
condition: service_completed_successfully
mongodb:
condition: service_healthy
kafka:
condition: service_healthy
volumes:
- './.env:/driver/.env'
- './migrations/driver/:/driver/migrations/driver/'
ports:
- ${DRIVER_PORT}:${DRIVER_PORT}
mongodb:
env_file:
- .env
image: mongo:latest
container_name: mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${DRIVER_DB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${DRIVER_DB_PASSWORD}
MONGO_INITDB_DATABASE: ${DRIVER_DB}
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/${DRIVER_DB} --quiet
interval: 10s
timeout: 10s
retries: 3
start_period: 20s
postgresql:
env_file:
- .env
image: postgres:latest
container_name: postgresql
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${LOCATION_DB_USER}
POSTGRES_PASSWORD: ${LOCATION_DB_PASSWORD}
POSTGRES_DB: ${LOCATION_DB}
healthcheck:
test: "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"
interval: 10s
timeout: 5s
retries: 5
prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- "9090:9090"
restart: unless-stopped
volumes:
- ./deployments/prometheus:/etc/prometheus
- prom_data:/prometheus
grafana:
image: grafana/grafana
container_name: grafana
ports:
- "3000:3000"
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./deployments/grafana:/etc/grafana/provisioning/datasources
jaeger-all-in-one:
image: jaegertracing/all-in-one:latest
restart: always
ports:
- "16686:16686"
- "14268"
- "14250"
otel-collector:
image: otel/opentelemetry-collector:0.88.0
restart: always
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
- ./deployments/otel/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
depends_on:
- jaeger-all-in-one
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "22181:2181"
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
- zookeeper
ports:
- "29092:29092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: INTERNAL://0.0.0.0:9092,OUTSIDE://0.0.0.0:29092
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092,OUTSIDE://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CREATE_TOPICS: "driver:1:1"
healthcheck:
test: nc -z localhost 29092 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
volumes:
prom_data: