-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
94 lines (94 loc) · 3.07 KB
/
docker-compose.yml
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
services:
full_text_searcher:
image: ghcr.io/hathitrust/ht_full_text_search:unstable
environment: &solr_env
ENV: ${ENV:-dev}
SOLR_USER: ${SOLR_USER:-admin}
SOLR_PASSWORD: ${SOLR_PASSWORD:-solrRocks}
volumes:
- .:/app
stdin_open: true
depends_on:
data_loader:
condition: service_completed_successfully
tty: true
container_name: full_text_searcher
full_text_search_api:
image: ghcr.io/hathitrust/ht_full_text_search:unstable
environment: *solr_env
stdin_open: true
depends_on:
solr-lss-dev:
condition: service_healthy
tty: true
container_name: full_text_search_api
ports:
- "8000:8000"
command: [ "python", "main.py", "--env", $ENV ]
test:
container_name: full_text_searcher_test
image: ghcr.io/hathitrust/ht_full_text_search:unstable
environment: *solr_env
volumes:
- .:/app
command: [ "pytest" ]
depends_on:
solr-lss-dev:
condition: service_healthy
data_loader:
condition: service_completed_successfully
solr-lss-dev:
image: ghcr.io/hathitrust/full-text-search-cloud:shards-docker
container_name: solr-lss-dev
ports:
- "8983:8983"
environment:
<<: *solr_env
ZK_HOST: zoo1:2181
SOLR_OPTS: -XX:-UseLargePages
depends_on:
zoo1:
condition: service_healthy
volumes:
- solr1_data:/var/solr/data
# start solr in the background, wait for it to start, then create the collection
command: [ "sh", "-c", 'solr-foreground -c & sleep 150 && export SOLR_AUTHENTICATION_OPTS=-Dbasicauth=admin:solrRocks && solr create_collection -d /opt/solr/core-x -c core-x -shards 1 -replicationFactor 1 -p 8983 && wait' ]
healthcheck:
test: [ "CMD-SHELL", "curl -s -u admin:solrRocks 'http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS&collection=core-x' | grep -q '\"state\":\"active\"'" ]
interval: 30s
timeout: 30s
start_period: 30s
retries: 10
zoo1:
image: zookeeper:3.8.0
container_name: zoo1
restart: always
hostname: zoo1
ports:
- 2181:2181
- 7001:7000
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zoo1:2888:3888;2181
ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok
ZOO_CFG_EXTRA: "metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider metricsProvider.httpPort=7000 metricsProvider.exportJvmInfo=true"
volumes:
- zoo1_data:/data
healthcheck:
test: [ "CMD", "echo", "ruok", "|", "nc", "localhost", "2181", "|", "grep", "imok" ]
interval: 30s
timeout: 10s
retries: 5
data_loader: # It is probably for this application I should create the image first
image: ghcr.io/hathitrust/ht_full_text_search:unstable
entrypoint: [ "/bin/sh", "-c" ,"/app/indexing_data.sh http://solr-lss-dev:8983 $SOLR_PASSWORD /app/solr_dataset core-x" ]
volumes:
- .:/app
environment: *solr_env
depends_on:
solr-lss-dev:
condition: service_healthy
volumes:
solr1_data: null
zoo1_data: null
app: