Sign inSign up

cs2ag/docker-solr

By cs2ag

•Updated 4 months ago

A Docker container with Solr Server based on https://github.com/TYPO3-Solr/ext-solr

Image
0

1.9K

cs2ag/docker-solr repository overview

⁠Solr Docker container

A Docker container with Solr Server based on Apache Solr for TYPO3 CMS⁠. More info here⁠

⁠Usage

Docker image from Apache Solr for TYPO3 CMS⁠ is based on official Apache Solr docker image⁠.
That means that also THIS image exports a volume /var/solr for persistent data.
Moreover THIS image also supports extension mechanims. At run time, before starting Solr, the container will execute scripts in the /docker-entrypoint-initdb.d/ directory. Use bind mounts⁠ for adding custom scripts into container. More info here⁠.

docker run -d \
  -v /root/solr:/docker-entrypoint-initdb.d \
  --name cs2-typo3s-solr-server \
  -p 8983:8983 \
  cs2ag/docker-solr:v10.0

⁠Environmental variables

Specify environment variables within file that ends with '.sh' extension.

cat /root/solr/env.sh #script needs to end with '.sh' extension
export SOLR_HEAP=1024m

Then use bind mount⁠ of docker host directory into the container with -v option - see Usage⁠ section

-v /root/solr:/docker-entrypoint-initdb.d

⁠Exposing ports

In case there are running multiple docker containers of Sorl server you need to specify unused (free) port on docker host level.
For example default port of Solr server (port 8983) is already in use then you need to specify another unused (free) port (e.g. 8984) on docker host with -p option - see Usage⁠ section

-p 8984:8983

More info here⁠.

⁠Create Solr core into docker container

You can interact with Solr server via CoreAdmin API calls⁠ in order to create/unload/status of solr core.
Below example shows API call for create/unload (remove)/status. Docker container is expected to be running on default 8983 sorl port.

core=test
curl "http://localhost:8983/solr/admin/cores?action=CREATE&&name=$core&configSet=ext_solr_14_0_0&schema=english/schema.xml&instanceDir=/var/solr/data/cores/$core&dataDir=/var/solr/data/data/$core"
curl "http://localhost:8983/solr/admin/cores?action=STATUS&core=$core"
curl "http://localhost:8983/solr/admin/cores?action=UNLOAD&core=$core&deleteIndex=true&deleteDataDir=true&deleteInstanceDir=true"

⁠Restart docker container with Solr server

docker restart CONTAINER_NAME

⁠Author


Tag summary

Content type

Image

Digest

sha256:d79f6e857…

Size

492.7 MB

Last updated

4 months ago

docker pull cs2ag/docker-solr