Skip to content

Instantly share code, notes, and snippets.

@tmotyl
Last active June 13, 2018 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmotyl/a67e49e3930a2d24e6b3c9a22e8241ea to your computer and use it in GitHub Desktop.
Save tmotyl/a67e49e3930a2d24e6b3c9a22e8241ea to your computer and use it in GitHub Desktop.
TYPO3 Solr DDEV docker image
#this makes local domain being available for crawling from within docker web container
#see https://github.com/drud/ddev/issues/842
version: '3'
services:
web:
extra_hosts:
- "${DDEV_SITENAME}.ddev.local:127.0.0.1"
# ddev apache solr recipe file for TYPO3 Solr extension https://github.com/TYPO3-Solr/ext-solr
#
# To use this in your own project: Copy this file to your project's .ddev folder,
# and create the folder path .ddev/solr. Then, copy the solr configuration
# files for your project to .ddev/solr/conf. E.g., using TYPO3 Solr extension
# you would copy the solr/Resources/Private/Solr contents into .ddev/solr.
#
# In TYPO3 use following configuration:
# host: solr
# port: 8983
# you can access the solr admin panel using http://<project-name>.ddev.local:8983/solr/
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: typo3solr/ext-solr:8.0.3
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:/opt/solr/server/solr"
# 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
web:
links:
- solr:$DDEV_HOSTNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment