It also allows you to easily start and stop the entire stack with one command, which means that your services only run when you really need them. Docker solves both problems by allowing you to clearly describe your stack and share this definition among your team members. Installing all this services to the developer's workstation can be complicated and can eat a lot of resources. In order to make the development as similar as possible to the production environments we need most of those services. Nowadays we need much more Apache Solr for running search, Memcached or Redis as a fast cache storage backend, reverse proxies like Varnish and more. Days when LAMP was enough to run them are a distant past. Modern web applications can become very complex. I will update this post as I evolve my approach and learn better ways of doing things. The purpose of this post is to document how I do it and hopefully get some feedback from other Docker users. Just restart docker containers so solr service gets loaded with new config.I've been using a Docker based development environment for about a year. This should be it, you should now have running solr service that can index your data. So it will be visible and your environment can use it. Solr server URI Solr core URI Also when using docker4drupal you should edit your /etc/hosts file and add line like 127.0.0.1 solr.dd.local You should set solr host to name of your container and with internal port number, so host will probably be solr and port will be 8983. As we are using docker, although over browser you can reach your solr over url like this this should not be in your config in drupal ui. We wont go into details about search api, but will just make an important note here. So we go to search api here admin/config/search/search-apiĪnd go to add server and index. Last step is to configure drupal with drupal ui. We copied files and they are now in /opt/solr/server/solr/test_core/conf ready to be used. container_solr:/opt/solr/server/solr/test_core/conf docker cp /Users/marko/my_site/web/modules/contrib/search_api_solr/solr-conf/6.x/. To copy all that to our container, you need to find a name of solr container and then copy content, lets do it like this. If you have solr 7.x installed, just use config for 6.x from drupal module. We choose a corresponding version of config per our solr installation. We want to copy DRUPAL specific solr config, which we can find with search_api_solr module /modules/contrib/search_api_solr/solr-conf Go into that folder and delete conf directory content and then go into it. With that we will get a new folder with some config. Then lets make a NEW CORE, we do it like this /opt/solr/bin/solr create -c test_core Then go to your solr installation and path where you need to put new cores, probably it will be here /opt/solr/server/solr First log in to your solr container, lets do it like this docker-compose exec solr bash Then first thing you need to do is to make a new CORE for solr, you can make that manually just adding files to your solr installation or run the command that makes that. First you need to make sure solr runs properly, test it, see that url to it shows it runs. But to make this work it needs some manual work as well. With docker4drupal its easy to enable solr whith docker-compose, its is also easy to do that with other drupal docker bundles.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |