Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (73 loc) · 1.89 KB
/
Copy pathdocker-compose.yml
File metadata and controls
78 lines (73 loc) · 1.89 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
# docker-compose.yml
version: "3.8"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.3
container_name: elasticsearch
environment:
- discovery.type=single-node
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD} # Set a password
- xpack.security.http.ssl.enabled=false
ports:
- "9200:9200"
volumes:
- es_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD", "curl", "-u", "elastic:${ELASTIC_PASSWORD}", "-f", "http://localhost:9200/_cluster/health?pretty"]
interval: 10s
timeout: 10s
retries: 5
kibana:
image: docker.elastic.co/kibana/kibana:9.1.3
container_name: kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
# Add credentials for Kibana to connect to the secured Elasticsearch
- ELASTICSEARCH_SERVICEACCOUNTTOKEN=${ELASTIC_TOKEN}
ports:
- "5601:5601"
depends_on:
elasticsearch:
condition: service_healthy
fastapi:
build: .
container_name: fastapi
ports:
- "8000:8000"
depends_on:
mongodb:
condition: service_healthy
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
environment:
- MONGO_URI=${MONGO_URI}
- REDIS_URI=${REDIS_URI}
# Update ES_URI to include credentials
- ES_URI=${ES_URI}
mongodb:
image: mongo:8.0
container_name: mongodb
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh mongodb://localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
redis:
image: redis:8.2
container_name: redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mongo_data:
es_data: