# To use this in your own project: Copy this file to your project's .ddev folder,
# and create the folder path .ddev/solr/conf. Then, copy the solr configuration
# files for your project to .ddev/solr/conf. E.g., using Drupal Search API Solr,
# you would copy the solr-conf/5.x/ contents into .ddev/solr/conf. The configuration
# files must be present before running `ddev start`.
version:'3'
services:
solr:# This is the service name used when running ddev commands accepting the --service flag
container_name:ddev-${DDEV_SITENAME}-solr# This is the name of the container. It is recommended to follow the same name convention used in the main docker-compose.yml file.
image:solr:6.3.0
restart:always
ports:
-8983# Solr is served from this port inside the container
labels:
# These labels ensure this service is discoverable by ddev
com.ddev.site-name:${DDEV_SITENAME}
com.ddev.approot:$DDEV_APPROOT
com.ddev.app-url:$DDEV_URL
environment:
-VIRTUAL_HOST=$DDEV_HOSTNAME# This defines the host name the service should be accessible from. This will be sitename.ddev.local
-HTTP_EXPOSE=8983# This defines the port the service should be accessible from at sitename.ddev.local
volumes:
-"./solr:/solr-conf"# This exposes a mount to the host system `.ddev/solr-conf` directory.
# This links the solr service to the web service defined in the main docker-compose.yml, allowing applications running in the web service to access the solr service at sitename.ddev.local:8983
Add a ddev config with a solr container and preconfigured core "t3o". You just need to access "solr:8983" within your ddev web container. The solr can be accessed via http://ter.ddev.local:8983. Ignore the solr error message regarding the core "dev".
## TypoScript setup for the solr container:
```
plugin.tx_solr.solr.host = solr
```
## Windows notes
You need to set an environment variable to get it to work within windows:
```
COMPOSE_CONVERT_WINDOWS_PATHS=1
```
For git-bash you can use:
```
export COMPOSE_CONVERT_WINDOWS_PATHS=1
```
see https://github.com/docker/for-win/issues/1829#issuecomment-376328022
After setting the environment variable and installing ddev/docker on your windows machine you can just type ddev start to setup your working copy.