docker-compose.solr.yaml 1.84 KB
Newer Older
1 2 3 4 5 6 7 8
# ddev apache solr recipe file
#
# To use this in your own project: Copy this file to your project's .ddev folder,
# and create the folder path .ddev/solr/conf. Then, copy the solr configuration
# files for your project to .ddev/solr/conf. E.g., using Drupal Search API Solr,
# you would copy the solr-conf/5.x/ contents into .ddev/solr/conf. The configuration
# files must be present before running `ddev start`.

Thomas Löffler's avatar
Thomas Löffler committed
9
version: '3.6'
10 11 12 13

services:
  solr: # This is the service name used when running ddev commands accepting the --service flag
    container_name: ddev-${DDEV_SITENAME}-solr # This is the name of the container. It is recommended to follow the same name convention used in the main docker-compose.yml file.
14
    image: solr:6.6.2
15
    restart: on-failure
16 17 18 19 20 21 22 23 24 25 26 27 28
    ports:
      - 8983 # Solr is served from this port inside the container
    labels:
    # These labels ensure this service is discoverable by ddev
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
      com.ddev.app-url: $DDEV_URL
    environment:
      - VIRTUAL_HOST=$DDEV_HOSTNAME # This defines the host name the service should be accessible from. This will be sitename.ddev.local
      - HTTP_EXPOSE=8983 # This defines the port the service should be accessible from at sitename.ddev.local
    volumes:
      - "./solr:/solr-conf" # This exposes a mount to the host system `.ddev/solr-conf` directory.
      - "./solr/configsets:/opt/solr/server/solr/configsets" # ext:solr configsets linking
29
      - "./solr/mycores:/opt/solr/server/solr/mycores"
30 31 32
    entrypoint:
      - docker-entrypoint.sh
      - solr-precreate
33
      - t3o
34 35 36 37
      - /solr-conf
# This links the solr service to the web service defined in the main docker-compose.yml, allowing applications running in the web service to access the solr service at sitename.ddev.local:8983
  web:
    links:
38
      - solr:$DDEV_HOSTNAME