How I tricked xp0 docker compose file to pickup Solr Core Prefix for Sitecore 10.0.1 Docker Instance

My earlier blog addressed how Sitecore 10.0.1 xp0 container doesn't pick any Solr Core Prefix name from .env file apart from the default "sitecore" prefix.

Based on my understanding of Docker images/containers, thought if I could accommodate prefixing through solr-init utilized in 10.1 container, basically trick the 10.0 compose file!, then the job must be done.

Here is a diagrammatic representation of the changes to Sitecore 10.0.1 Compose file:


On observation and comparison of the 10.0 and 10.1 compose files, I also realized that 10.1.x was using solrcloud, so it went without saying that I would utilize the same without much more experimentation since the goal is to pick up the .env file' solr core prefix.

A quick look at the diff between 10.0 compose vs 10.1 compose here below to understand what I mean:


With some basics in mind, I made changes to the 10.0.1 compose file and  this is how my docker-compose.yml looks after the changes.

Note that I made changes to solr port since my machine was busy on port 8984 but that is not related to this change!

Finally, docker compose up was fine and mostly importantly could see indexes getting populated with the SOLR_CORE_PREFIX_NAME specified in the .env file!

The job isn't accomplished until you rebuilt the solr indexes in Sitecore. If you get an index rebuild error, do populate solr indexes first  and retry indexing as per my last year blog.

All is fine if index rebuild is fine!


Finally, Sitecore 10.0.x container can take in solr core prefix name successfully with this new compose file in place!

My Sitecore version for reference:

Changes for reference:

Original vs new:

1.


2.


3.


Comments