-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.solr.yaml
More file actions
72 lines (72 loc) · 2.73 KB
/
docker-compose.solr.yaml
File metadata and controls
72 lines (72 loc) · 2.73 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
#ddev-generated
services:
solr:
image: ${SOLR_BASE_IMAGE:-solr:9}-${DDEV_SITENAME}-built
build:
dockerfile_inline: |
ARG SOLR_BASE_IMAGE="scratch"
FROM $$SOLR_BASE_IMAGE
# Fix HTTPS redirect to HTTP which breaks URL for Solr Admin UI.
# The reason for this problem is that Solr uses Jetty as a webserver.
# Jetty has X-Forwarded- headers disabled by default, enable them here:
USER root
RUN sed -i '/X-Forwarded-/,/-->/ {/<!--/d; /-->/d}' /opt/solr/server/etc/jetty.xml
# Use predefined values for username/password in Solr Admin UI.
RUN sed -i "/\$$rootScope.exceptions = {};/a \$$scope.username = 'solr'; \$$scope.password = 'SolrRocks';" /opt/solr/server/solr-webapp/webapp/js/angular/controllers/login.js
USER solr
args:
SOLR_BASE_IMAGE: ${SOLR_BASE_IMAGE:-solr:9}
container_name: ddev-${DDEV_SITENAME}-solr
expose:
- 8983
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: ${DDEV_APPROOT}
environment:
SOLR_HOST: ddev-${DDEV_SITENAME}-solr
SOLR_PORT: 8983
# The pre-trained OpenNLP models require a much bigger buffer.
SOLR_OPTS: -Djute.maxbuffer=50000000
#SOLR_HEAP: 1g
SOLR_AUTH_TYPE: basic
SOLR_AUTHENTICATION_OPTS: -Dbasicauth=solr:SolrRocks
# needed for Drupal Search API Solr
SOLR_MODULES: ${SOLR_MODULES-extraction,langid,ltr,analysis-extras}
VIRTUAL_HOST: ${DDEV_HOSTNAME}
HTTP_EXPOSE: 8983:8983
HTTPS_EXPOSE: 8943:8983
volumes:
- .:/mnt/ddev_config
- ddev-global-cache:/mnt/ddev-global-cache
- ./solr/lib:/opt/solr/modules/ddev/lib
- solr:/var/solr
command:
- bash
- -c
- |
set -eu -o pipefail
docker-entrypoint.sh solr start -c -Dlog4j.configurationFile=/opt/solr/server/resources/log4j2-console.xml
solr zk cp file:/mnt/ddev_config/solr/security.json zk:/security.json -z localhost:9983
cd /mnt/ddev_config/solr/configsets
for dir in */; do
dir="$${dir%/}"
if [[ "$$dir" != "*" ]]; then
echo "uploading configset $$dir"
solr zk upconfig -n "$$dir" -d "$$dir" -z localhost:9983
echo "creating collection $$dir"
solr create -c "$$dir" -n "$$dir" -shards 1 -replicationFactor 1 || true
fi
done
cd -
solr stop > /dev/null
exec solr-foreground -c -Dlog4j.configurationFile=/opt/solr/server/resources/log4j2.xml
healthcheck:
test: ["CMD-SHELL", "curl --fail -s localhost:8983/solr/"]
x-ddev:
describe-info: |
User: solr
Pass: SolrRocks
Image: ${SOLR_BASE_IMAGE:-solr:9}
ssh-shell: bash
volumes:
solr: