-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
224 lines (216 loc) · 5.43 KB
/
docker-compose.yml
File metadata and controls
224 lines (216 loc) · 5.43 KB
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
version: "3.9"
services:
backend:
build: .
env_file: .env
container_name: "DataSpace"
command: uvicorn DataSpace.asgi:application --host 0.0.0.0 --port 8000 --reload
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
backend_db:
condition: service_healthy
elasticsearch:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
logging:
options:
max-size: "10m"
max-file: "3"
backend_db:
image: "postgres:14.4"
env_file: .env
restart: always
container_name: "DataExBackendDb"
environment:
- POSTGRES_NAME=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "54321:5432"
volumes:
- backend_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
logging:
options:
max-size: "10m"
max-file: "3"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.2
restart: always
container_name: "DataExBackendElastic"
env_file: .env
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
- ELASTIC_PASSWORD=changeme
- xpack.security.enabled=true
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'"]
interval: 20s
timeout: 10s
retries: 3
start_period: 40s
logging:
options:
max-size: "10m"
max-file: "3"
redis:
image: "redis:alpine"
restart: always
command: redis-server
container_name: "DataExBackendRedis"
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep -q 'PONG'"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
logging:
options:
max-size: "10m"
max-file: "3"
telemetry_elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2
container_name: telemetry_elasticsearch
restart: always
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
- ELASTIC_PASSWORD=changeme
- xpack.security.enabled=true
volumes:
- tele-elasticsearch-data:/usr/share/elasticsearch/data
healthcheck:
interval: 10s
retries: 12
test:
curl -s http://localhost:9200/_cluster/health | grep -vq
'"status":"red"'
logging:
options:
max-size: "10m"
max-file: "3"
kibana:
image: docker.elastic.co/kibana/kibana:7.16.2
container_name: kibana
environment:
ELASTICSEARCH_URL: "http://telemetry_elasticsearch:9200"
ELASTICSEARCH_HOSTS: '["http://telemetry_elasticsearch:9200"]'
ELASTICSEARCH_USERNAME: elastic
ELASTICSEARCH_PASSWORD: changeme
restart: always
depends_on:
telemetry_elasticsearch:
condition: service_healthy
ports:
- 5601:5601
apm-server:
image: docker.elastic.co/apm/apm-server:7.16.2
container_name: apm-server
user: apm-server
restart: always
command:
[
"--strict.perms=false",
"-e",
"-E",
"apm-server.host=0.0.0.0:8200",
"-E",
"apm-server.kibana.enabled=true",
"-E",
"apm-server.kibana.host=kibana:5601",
"-E",
"apm-server.kibana.username=elastic",
"-E",
"apm-server.kibana.password=changeme",
"-E",
"output.elasticsearch.hosts=['telemetry_elasticsearch:9200']",
"-E",
"output.elasticsearch.enabled=true",
"-E",
"output.elasticsearch.username=elastic",
"-E",
"output.elasticsearch.password=changeme",
]
depends_on:
telemetry_elasticsearch:
condition: service_healthy
cap_add: [ "CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID" ]
cap_drop: [ "ALL" ]
healthcheck:
interval: 10s
retries: 12
test:
curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null
http://localhost:8200/
logging:
options:
max-size: "10m"
max-file: "3"
otel-collector:
image: otel/opentelemetry-collector:latest
container_name: otel-collector
restart: always
command: "--config=/etc/otel-collector-config.yaml"
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
depends_on:
apm-server:
condition: service_healthy
ports:
- 4317:4317
logging:
options:
max-size: "10m"
max-file: "3"
volumes:
backend_db_data:
name: backend_db_data
elasticsearch-data:
driver: local
tele-elasticsearch-data:
driver: local
redis-data:
driver: local