diff --git a/docker/Dockerfile-solr9 b/docker/Dockerfile-solr9 new file mode 100644 index 0000000..051e0bc --- /dev/null +++ b/docker/Dockerfile-solr9 @@ -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>/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"] diff --git a/docker/solr9.yml b/docker/solr9.yml new file mode 100644 index 0000000..f80b1b6 --- /dev/null +++ b/docker/solr9.yml @@ -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