devilbox/docs/custom-container/enable-solr.rst
2020-03-24 09:29:21 +01:00

6.5 KiB

Enable and configure Solr

This section will guide you through getting Solr integrated into the Devilbox.

* * * custom_container_enable_all_additional_container * docker_compose_override_yml_how_does_it_work

Table of Contents

local

Overview

Available overwrites

Solr settings

In case of Solr, the file is compose/docker-compose.override.yml-solr. This file must be copied into the root of the Devilbox git directory.

What How and where
Example compose file compose/docker-compose.override.yml-all or compose/docker-compose.override.yml-solr
Container IP address 172.16.238.220
Container host name solr
Container name solr
Mount points via Docker volumes
Exposed port 8983 (can be changed via .env)
Available at http://localhost:8983 (API and Admin WebUI)
Further configuration none

Solr env variables

Additionally the following .env variables can be created for easy configuration:

Variable Default value Description
HOST_PORT_SOLR 8983 Controls the host port on which Solr API and WebUIwill be available at.
SOLR_SERVER latest Controls the Solr version to use.
SOLR_CORE_NAME devilbox Default Solr core name

Instructions

1. Copy docker-compose.override.yml

Copy the Solr Docker Compose overwrite file into the root of the Devilbox git directory. (It must be at the same level as the default docker-compose.yml file).

host> cp compose/docker-compose.override.yml-solr docker-compose.override.yml

* docker_compose_override_yml * add_your_own_docker_image * overwrite_existing_docker_image

2. Adjust .env settings (optional)

Solr is using sane defaults, which can be changed by adding variables to the .env file and assigning custom values.

Add the following variables to .env and adjust them to your needs:

# Solr version to choose
#SOLR_SERVER=5
#SOLR_SERVER=6
#SOLR_SERVER=7
SOLR_SERVER=latest

SOLR_CORE_NAME=devilbox
HOST_PORT_SOLR=8983

env_file

3. Start the Devilbox

The final step is to start the Devilbox with Solr.

Let's assume you want to start php, httpd, bind, solr.

host> docker-compose up -d php httpd bind solr

start_the_devilbox

TL;DR

For the lazy readers, here are all commands required to get you started. Simply copy and paste the following block into your terminal from the root of your Devilbox git directory:

# Copy compose-override.yml into place
cp compose/docker-compose.override.yml-solr docker-compose.override.yml

# Create .env variable
echo "# Solr version to choose"         >> .env
echo "#SOLR_SERVER=5"                   >> .env
echo "#SOLR_SERVER=6"                   >> .env
echo "#SOLR_SERVER=7"                   >> .env
echo "SOLR_SERVER=latest"               >> .env
echo "SOLR_CORE_NAME=devilbox"          >> .env
echo "HOST_PORT_SOLR=8983"              >> .env

# Start container
docker-compose up -d php httpd bind solr