-
-
Notifications
You must be signed in to change notification settings - Fork 160
/
docker-compose.solr.yaml
87 lines (80 loc) · 3.71 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
84
85
86
87
# DDev Apache Solr recipe file.
#
# 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:7
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:/opt/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`. The file must be
# executable (`chmod +x .ddev/solr/solr-configupdate.sh`)
- "./solr/solr-configupdate.sh:/docker-entrypoint-initdb.d/solr-configupdate.sh"
entrypoint: [ "sh", "-c", "docker-entrypoint.sh solr-precreate dev /solr-conf" ]
external_links:
- "ddev-router:${DDEV_SITENAME}.${DDEV_TLD}"
healthcheck:
test: ["CMD-SHELL", "curl --fail -s localhost:8983/solr/"]
# This links the Solr service to the web service defined in the main
# docker-compose.yml, allowing applications running inside the web container to
# access the Solr service at http://solr:8983
web:
links:
- solr:solr
volumes:
# solr is a persistent Docker volume for solr data
# The persistent volume should have the same name as the service so it can be deleted
# when the project is deleted.
solr:
name: "ddev-${DDEV_SITENAME}_solr"