Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docker/Dockerfile-solr9
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM solr:9-slim

# Switch to root user to perform setup tasks
USER root

# Copy all Solr configuration files from the project into a temporary directory in the container
COPY vendor/ibexa/solr/src/lib/Resources/config/solr/ /opt/solr/server/tmp

# Create the ezcloud template directory and set correct ownership for Solr
RUN mkdir -p /opt/solr/server/ezcloud/template/conf \
&& chown -R solr:solr /opt/solr/server/ezcloud

# Copy specific Solr configuration files into the template directory
COPY vendor/ibexa/solr/src/lib/Resources/config/solr/managed-schema.xml /opt/solr/server/ezcloud/template/conf
COPY vendor/ibexa/solr/src/lib/Resources/config/solr/custom-fields-types-solr9.xml /opt/solr/server/ezcloud/template/conf
COPY vendor/ibexa/solr/src/lib/Resources/config/solr/language-fieldtypes.xml /opt/solr/server/ezcloud/template/conf
COPY vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages /opt/solr/server/ezcloud/template/conf

# Copy default Solr config files into the template and adjust solrconfig.xml as needed
RUN cp /opt/solr/server/solr/configsets/_default/conf/solrconfig.xml /opt/solr/server/ezcloud/template/conf \
&& cp /opt/solr/server/solr/configsets/_default/conf/stopwords.txt /opt/solr/server/ezcloud/template/conf \
&& cp /opt/solr/server/solr/configsets/_default/conf/synonyms.txt /opt/solr/server/ezcloud/template/conf \
&& cp /opt/solr/server/solr/solr.xml /opt/solr/server/ezcloud \
# Remove the updateRequestProcessorChain block from solrconfig.xml
&& sed -i.bak '/<updateRequestProcessorChain name="add-unknown-fields-to-the-schema">/,/<\/updateRequestProcessorChain>/d' /opt/solr/server/ezcloud/template/conf/solrconfig.xml \
# Change the autoSoftCommit maxTime default value in solrconfig.xml
&& sed -ie 's/${solr.autoSoftCommit.maxTime:-1}/${solr.autoSoftCommit.maxTime:20}/' /opt/solr/server/ezcloud/template/conf/solrconfig.xml

# Switch back to the solr user for running Solr
USER solr

# Set the Solr home directory environment variable
ENV SOLR_HOME /var/solr/data

# Start Solr and create a new collection using the custom template
CMD ["solr-create", "-c", "collection1", "-d", "/opt/solr/server/ezcloud/template"]
26 changes: 26 additions & 0 deletions docker/solr9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Solr config, to be appended after base-prod or base-dev, ..., but before selenium.yml
#
# NOTE: You'll need to manually reindex the solr index when booting this as we don't have entrypoint for solr yet.
# (Unless you use ezplatform:install command which indexes for you)

## WARNING!
# This service is currently work in progress, is not tested by CI, and thus not guaranteed to work.
# You are however more then welcome to try it out and help make it stable.

services:
app:
depends_on:
- solr
environment:
- SEARCH_ENGINE=solr
- SOLR_DSN=http://solr:8983/solr

solr:
build:
context: ../../
dockerfile: doc/docker/Dockerfile-solr9
ports:
- "8983:8983"
networks:
- frontend
- backend
Loading