mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-18 02:40:04 +00:00
Adding new container: Solr
This commit is contained in:
parent
32fe1ffb5f
commit
a4c1a1b72c
@ -278,20 +278,29 @@ Additionally to the default stack, there are a variety of other services that ca
|
||||
<tr>
|
||||
<th>MailHog</th>
|
||||
<th>RabbitMQ</th>
|
||||
<th>Solr</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>v1.0.0</td>
|
||||
<td>3.6</td>
|
||||
<td>5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>latest</td>
|
||||
<td>3.7</td>
|
||||
<td>6</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>latest</td>
|
||||
<td>7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>latest</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -34,3 +34,25 @@ services:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
|
||||
solr:
|
||||
image: solr:${SOLR_SERVER:-latest}
|
||||
hostname: solr
|
||||
ports:
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_SOLR:-8983}:8983"
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.220
|
||||
volumes:
|
||||
- data-solr:/opt/solr/server/solr/mycores
|
||||
entrypoint:
|
||||
- docker-entrypoint.sh
|
||||
- solr-precreate
|
||||
- ${SOLR_CORE_NAME:-devilbox}
|
||||
depends_on:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
|
||||
volumes:
|
||||
data-solr:
|
||||
|
24
compose/docker-compose.override.yml-solr
Normal file
24
compose/docker-compose.override.yml-solr
Normal file
@ -0,0 +1,24 @@
|
||||
version: '2.1'
|
||||
|
||||
services:
|
||||
solr:
|
||||
image: solr:${SOLR_SERVER:-latest}
|
||||
hostname: solr
|
||||
ports:
|
||||
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_SOLR:-8983}:8983"
|
||||
networks:
|
||||
app_net:
|
||||
ipv4_address: 172.16.238.220
|
||||
volumes:
|
||||
- data-solr:/opt/solr/server/solr/mycores
|
||||
entrypoint:
|
||||
- docker-entrypoint.sh
|
||||
- solr-precreate
|
||||
- ${SOLR_CORE_NAME:-devilbox}
|
||||
depends_on:
|
||||
- bind
|
||||
- php
|
||||
- httpd
|
||||
|
||||
volumes:
|
||||
data-solr:
|
@ -51,3 +51,15 @@
|
||||
<a target="_blank" href="https://hub.docker.com/_/rabbitmq/">
|
||||
Dockerhub: RabbitMQ <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_solr_github| raw:: html
|
||||
|
||||
<a target="_blank" href="https://github.com/apache/lucene-solr">
|
||||
Github: Solr <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
||||
.. |ext_lnk_solr_dockerhub| raw:: html
|
||||
|
||||
<a target="_blank" href="https://hub.docker.com/_/solr/">
|
||||
Dockerhub: Solr <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
|
||||
</a>
|
||||
|
@ -5,3 +5,5 @@
|
||||
+---------------------------+----------+----------+----------------+
|
||||
| RabbitMQ | rabbit | rabbit | 172.16.238.210 |
|
||||
+---------------------------+----------+----------+----------------+
|
||||
| Solr | solr | solr | 172.16.238.220 |
|
||||
+---------------------------+----------+----------+----------------+
|
||||
|
@ -11,8 +11,9 @@ However, each example also exists in its standalone file as shown below:
|
||||
├── docker-compose.override.yml-all
|
||||
├── docker-compose.override.yml-mailhog
|
||||
├── docker-compose.override.yml-rabbitmq
|
||||
├── docker-compose.override.yml-solr
|
||||
└── README.md
|
||||
|
||||
0 directories, 4 files
|
||||
0 directories, 5 files
|
||||
|
||||
.. seealso:: :ref:`custom_container_enable_all_additional_container`
|
||||
|
@ -55,3 +55,4 @@ In order to fully customize each container, refer to their own documentation sec
|
||||
.. seealso::
|
||||
* :ref:`custom_container_enable_mailhog`
|
||||
* :ref:`custom_container_enable_rabbitmq`
|
||||
* :ref:`custom_container_enable_solr`
|
||||
|
151
docs/custom-container/enable-solr.rst
Normal file
151
docs/custom-container/enable-solr.rst
Normal file
@ -0,0 +1,151 @@
|
||||
.. include:: /_includes/all.rst
|
||||
|
||||
.. _custom_container_enable_solr:
|
||||
|
||||
*************************
|
||||
Enable and configure Solr
|
||||
*************************
|
||||
|
||||
This section will guide you through getting Solr integrated into the Devilbox.
|
||||
|
||||
.. seealso::
|
||||
* |ext_lnk_solr_github|
|
||||
* |ext_lnk_solr_dockerhub|
|
||||
* :ref:`custom_container_enable_all_additional_container`
|
||||
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. contents:: :local:
|
||||
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
Available overwrites
|
||||
--------------------
|
||||
|
||||
.. include:: /_includes/snippets/docker-compose-override-tree-view.rst
|
||||
|
||||
|
||||
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 |br| ``compose/docker-compose.override.yml-solr`` |
|
||||
+-----------------------+------------------------------------------------------------------------------------------------------+
|
||||
| Container IP address | ``172.16.238.220`` |
|
||||
+-----------------------+------------------------------------------------------------------------------------------------------+
|
||||
| Container host name | ``solr`` |
|
||||
+-----------------------+------------------------------------------------------------------------------------------------------+
|
||||
| Container name | ``solr`` |
|
||||
+-----------------------+------------------------------------------------------------------------------------------------------+
|
||||
| Mount points | none |
|
||||
+-----------------------+------------------------------------------------------------------------------------------------------+
|
||||
| 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).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
host> cp compose/docker-compose.override.yml-solr docker-compose.override.yml
|
||||
|
||||
.. seealso::
|
||||
* :ref:`docker_compose_override_yml`
|
||||
* :ref:`add_your_own_docker_image`
|
||||
* :ref:`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:
|
||||
|
||||
.. code-block:: bash
|
||||
:caption: .env
|
||||
|
||||
# Solr version to choose
|
||||
#SOLR_SERVER=5
|
||||
#SOLR_SERVER=6
|
||||
#SOLR_SERVER=7
|
||||
SOLR_SERVER=latest
|
||||
|
||||
SOLR_CORE_NAME=devilbox
|
||||
HOST_PORT_SOLR=8983
|
||||
|
||||
.. seealso:: :ref:`env_file`
|
||||
|
||||
|
||||
4. Start the Devilbox
|
||||
---------------------
|
||||
|
||||
The final step is to start the Devilbox with Solr.
|
||||
|
||||
Let's assume you want to start ``php``, ``httpd``, ``bind``, ``solr``.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
host> docker-compose up -d php httpd bind solr
|
||||
|
||||
.. seealso:: :ref:`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:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# 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
|
@ -96,6 +96,7 @@ host is ready to be served with your custom domain.
|
||||
custom-container/enable-all-container
|
||||
custom-container/enable-mailhog
|
||||
custom-container/enable-rabbitmq
|
||||
custom-container/enable-solr
|
||||
|
||||
|
||||
.. toctree::
|
||||
|
Loading…
Reference in New Issue
Block a user