docker-ckan/solr/Dockerfile

35 lines
1.6 KiB
Docker
Raw Normal View History

2021-01-15 16:05:22 +01:00
FROM solr:6.6.6
2014-10-26 22:21:58 +01:00
2021-01-15 16:05:22 +01:00
# Enviroment variables
ENV SOLR_CORE ckan
2021-10-29 17:05:48 +02:00
ENV SOLR_VERSION 6.6.6
2021-12-10 11:43:04 +01:00
ENV CKAN_VERSION 2.9.4
2021-10-29 17:05:48 +02:00
###TODO!!! CKAN_VERSION to be passed in as an ARG
2014-10-26 22:21:58 +01:00
2021-01-15 16:05:22 +01:00
# root user for initial config
USER root
2014-10-26 22:21:58 +01:00
2021-01-15 16:05:22 +01:00
# Create directories
RUN mkdir -p /opt/solr/server/solr/${SOLR_CORE}/conf && \
mkdir -p /opt/solr/server/solr/${SOLR_CORE}/data && \
mkdir -p /opt/solr/server/solr/${SOLR_CORE}/data/index
2021-01-15 16:05:22 +01:00
# Add files
2021-12-10 11:43:04 +01:00
COPY solrconfig-${CKAN_VERSION}.xml /opt/solr/server/solr/${SOLR_CORE}/conf/solrconfig.xml
ADD https://raw.githubusercontent.com/ckan/ckan/ckan-${CKAN_VERSION}/ckan/config/solr/schema.xml \
https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/currency.xml \
https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/synonyms.txt \
https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/stopwords.txt \
https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/protwords.txt \
https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/data_driven_schema_configs/conf/elevate.xml \
/opt/solr/server/solr/${SOLR_CORE}/conf/
2014-10-26 22:21:58 +01:00
2021-01-15 16:05:22 +01:00
# Create core.properties
RUN echo name=${SOLR_CORE} > /opt/solr/server/solr/${SOLR_CORE}/core.properties
# Giving ownership to Solr
2021-01-15 16:05:22 +01:00
RUN chown -R ${SOLR_USER}:${SOLR_USER} /opt/solr/server/solr/${SOLR_CORE}
# non-root user for runtime
USER ${SOLR_USER}:${SOLR_USER}