-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (85 loc) · 2.7 KB
/
docker-compose.yml
File metadata and controls
92 lines (85 loc) · 2.7 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
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2
container_name: es8
ports:
- "9200:9200"
- "9300:9300"
environment:
# Run as a single-node cluster (suitable for local development)
- discovery.type=single-node
# Disable security for local development (no authentication required)
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
# Limit JVM memory usage to avoid excessive RAM consumption
- ES_JAVA_OPTS=-Xms512m -Xmx512m
# Disable disk watermark checks (useful on dev machines with limited disk space)
- cluster.routing.allocation.disk.threshold_enabled=false
# Persist Elasticsearch data across container restarts
volumes:
- esdata:/usr/share/elasticsearch/data
networks:
- backend
redis:
image: redis:7-alpine
container_name: redis
# Only available inside the Docker network
networks:
- backend
##########################################################################
# Helper container responsible for managing the XML corpus repository.
#
# Responsibilities:
# - Clone the formulae-corpora repository into a persistent Docker volume
# - Update the repository when it already exists
# - Optionally rebuild Elasticsearch indices from the XML data
#
# This container is normally executed manually:
#
# docker compose run --rm formulae_corpora
#
# It is therefore placed in the "init" profile.
formulae_corpora:
build:
context: .
dockerfile: docker/Dockerfile.corpora
# Only started when explicitly requested
profiles: ["init"]
environment:
- FORMULAE_CORPORA_REPO_URL=${FORMULAE_CORPORA_REPO_URL}
- GITHUB_TOKEN=${GITHUB_TOKEN}
# Optional branch/tag/commit to checkout
- FORMULAE_CORPORA_REF=${FORMULAE_CORPORA_REF:-}
- ELASTICSEARCH_URL=${ELASTICSEARCH_URL}
- ELASTICSEARCH_VERSION=8.18.2
# If true, rebuild Elasticsearch indices after updating the corpus
- REBUILD_ELASTICSEARCH=${REBUILD_ELASTICSEARCH:-false}
volumes:
- formulae_corpora_data:/data
- ./docker/clone_corpora.sh:/clone_corpora.sh:ro
entrypoint: ["/bin/sh", "/clone_corpora.sh"]
depends_on:
- elasticsearch
- redis
networks:
- backend
nemo:
build: .
env_file: ".env"
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
- CORPUS_FOLDERS=/data
- PYTHONUNBUFFERED=1
- REDIS_URL=redis://redis:6379/0
volumes:
- formulae_corpora_data:/data:ro
ports:
- "5000:5000"
networks:
- backend
volumes:
esdata:
formulae_corpora_data:
networks:
backend:
driver: bridge