uselagoon / lagoon-images

This repository builds the images used in Lagoon and local development environments
Apache License 2.0
27 stars 33 forks source link

SOLR 8 entrypoints #472

Open almunnings opened 2 years ago

almunnings commented 2 years ago

As I understand it there is a race condition between mounting a volume over SOLR and lagoon/lando/pygmy which can be addressed by recreating the core ( https://github.com/uselagoon/lagoon-images/pull/97 )

The recommended way for getting a SOLR-8 running via @tobybellwood was something similar to:

FROM uselagoon/solr-8-drupal
CMD solr-recreate drupal /solr-conf && solr-foreground

This works great on lagoon But when working locally in a tool like lando, the command gets overridden to

/sbin/tini -- /lagoon/entrypoints.sh solr-foreground

This can be worked around by setting up the cmd again in the .lando.yml file as an override for the service, but it feels dirty writing this multiple times in a project.

Which got me thinking, what if its moved into an entrypoint?

FROM uselagoon/solr-8-drupal

USER root
RUN echo -e "#!/bin/bash\nsolr-recreate drupal /solr-conf" > /lagoon/entrypoints/90-solr.sh

USER solr
CMD ["solr-foreground"]

So the issue request is...

ocean commented 2 years ago

As a followup to this @tobybellwood we're using this approach for Solr 8 on our site (worked fine in testing for a few weeks, just deployed to production and seems to be going fine).

We have three Solr cores (one with 2 indexes), and I used the same approach as above, echo -ing the solr-recreate command for each core into /lagoon/entrypoints/90-solr-recreate.sh.

tobybellwood commented 2 years ago

Ok, I'll try make some time to get this up, I trust you two!