diff --git a/docker-compose.yml b/docker-compose.yml index d2fb4ae..2ea6214 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -674,6 +674,21 @@ services: networks: - frontend - backend + +### Solr Container ######################################### + + solr: + build: + context: ./solr + args: + - SOLR_VERSION=${SOLR_VERSION} + - SOLR_DATAIMPORTHANDLER_MYSQL=${SOLR_DATAIMPORTHANDLER_MYSQL} + volumes: + - ${DATA_SAVE_PATH}/solr:/opt/solr/server/solr/mycores + ports: + - "${SOLR_PORT}:8983" + networks: + - backend ### AWS EB-CLI #### aws: diff --git a/env-example b/env-example index c3d103d..c331ed0 100644 --- a/env-example +++ b/env-example @@ -323,6 +323,12 @@ CADDY_CUSTOM_CADDYFILE=./caddy/Caddyfile LARAVEL_ECHO_SERVER_PORT=6001 +### SOLR ############################################################################################################### + +SOLR_VERSION=5.5 +SOLR_PORT=8983 +SOLR_DATAIMPORTHANDLER_MYSQL=false + ### DOCKER-SYNC ################################################################################################ # osx: 'native_osx' (default) diff --git a/solr/Dockerfile b/solr/Dockerfile new file mode 100644 index 0000000..ba604a3 --- /dev/null +++ b/solr/Dockerfile @@ -0,0 +1,14 @@ +ARG SOLR_VERSION=5.5 +FROM solr:${SOLR_VERSION} + +ARG SOLR_DATAIMPORTHANDLER_MYSQL=false +ENV SOLR_DATAIMPORTHANDLER_MYSQL ${SOLR_DATAIMPORTHANDLER_MYSQL} + +# download mysql connector for dataimporthandler +RUN if [ ${SOLR_DATAIMPORTHANDLER_MYSQL} = true ]; then \ + curl -L -o /tmp/mysql_connector.tar.gz "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz" \ + && mkdir /opt/solr/contrib/dataimporthandler/lib \ + && tar -zxvf /tmp/mysql_connector.tar.gz -C /opt/solr/contrib/dataimporthandler/lib "mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar" --strip-components 1 \ + && rm /tmp/mysql_connector.tar.gz \ +;fi +