-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.solr.yaml
83 lines (76 loc) · 3.47 KB
/
docker-compose.solr.yaml
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
# DDEV Apache Solr recipe file.
#ddev-generated
#
#
# To use this in your own project:
# 1. Copy this file to your project's ".ddev" directory.
# 2. Create the folder path ".ddev/solr/conf".
# 3. Copy the Solr configuration files for the appropriate plugin/module to
# ".ddev/solr/conf". For example, using Drupal 8's Search API Solr module,
# you'll get the config files as a file config.zip from
# /admin/config/search/search-api/server/solr and unzip it into .ddev/solr/conf
# so that a file exists with the path ".ddev/solr/conf/solrconfig.xml".
#
# To access Solr after it is installed:
# - The Solr admin interface will be accessible at:
# http://<projectname>.ddev.site:8983/solr/
# For example, if the project is named "myproject" the hostname will be:
# http://myproject.ddev.site:8983/solr/
# - To access the Solr container from the web container use:
# http://solr:8983/solr/
# - A Solr core is automatically created with the name "dev" unless you
# change that usage throughout. It can be
# accessed at the URL: http://solr:8983/solr/dev (inside web container)
# or at http://myproject.ddev.site:8983/solr/dev (on the host)
services:
solr:
# Name of container using standard ddev convention
container_name: ddev-${DDEV_SITENAME}-solr
# The solr docker image is at https://hub.docker.com/_/solr/
# and code at https://github.com/docker-solr/docker-solr
# README: https://github.com/docker-solr/docker-solr/blob/master/README.md
# It's almost impossible to work with it if you don't read the docs there
image: solr:8
restart: "no"
# Solr is served from this port inside the container.
expose:
- 8983
# These labels ensure this service is discoverable by ddev.
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
environment:
# This defines the host name the service should be accessible from. This
# will be sitename.ddev.site.
- VIRTUAL_HOST=$DDEV_HOSTNAME
# HTTP_EXPOSE exposes http traffic from the container port 8983
# to the host port 8983 vid ddev-router reverse proxy.
- HTTP_EXPOSE=8983:8983
volumes:
# solr core *data* is stored on the 'solr' docker volume
# This mount is optional; without it your search index disappears
# each time the ddev project is stopped and started.
- solr:/var/solr
# This mounts the conf in .ddev/solr into the container where
# the solr-precreate command in the entrypoint uses it as a one-time
# configuration to copy config into the newly-created core. It is not
# used if the core has previously been created.
- ./solr:/solr-conf
- ".:/mnt/ddev_config"
# solr-configupdate.sh copies fresh configuration files into the
# solr container on each
# startup, so if you change the config in .ddev/solr/conf
# it will be refreshed on `ddev start`. It must be executable,
# `chmod +x solr
- "./solr/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d"
# The odd need to use $$SOLR_CORENAME here is explained in
# https://stackoverflow.com/a/48189916/215713
entrypoint: 'bash -c "VERBOSE=yes docker-entrypoint.sh solr-precreate $${SOLR_CORENAME:-dev} /solr-conf"'
external_links:
- "ddev-router:${DDEV_SITENAME}.${DDEV_TLD}"
healthcheck:
test: ["CMD-SHELL", "curl --fail -s localhost:8983/solr/"]
volumes:
# solr is a persistent Docker volume for solr data
solr:
name: "ddev-${DDEV_SITENAME}_solr"