Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solr.xml for when volume mounted at /var/solr/data in container #8

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ ENV CONFIGSET $CONFIGSET

USER root

COPY /vivocore/conf /opt/solr/server/solr/configsets/vivocore/conf
COPY /${CONFIGSET}/conf /opt/solr/server/solr/configsets/${CONFIGSET}/conf

COPY setup.sh /setup.sh

COPY solr.xml /solr.xml

RUN chown -R solr:solr /opt/solr/server/solr/configsets/vivocore
RUN chmod -R 755 /opt/solr/server/solr/configsets/vivocore
RUN \
chown -R solr:solr /opt/solr/server/solr/configsets/${CONFIGSET} && \
chmod -R 755 /opt/solr/server/solr/configsets/${CONFIGSET}

USER solr

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ When using Docker the Quick Start section below is not applicable
```
1. Start VIVO!

# Docker

Run latest vivo-solr on port 8983 with solr_data persisted volume.

```
docker run -d -p 8983:8983 -v solr_data:/var/solr/data vivoweb/vivo-solr:latest
```

To build the docker image:

```
docker build -t vivoweb/vivo-solr:latest .
```

# Credits
The VIVO-specific configuration and general source of this repository comes from:
[Huda Khan](https://github.com/hudajkhan) [SolrVIVOConfiguration](https://github.com/hudajkhan/SolrVIVOConfiguration)
6 changes: 6 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ if [[ "$RESET_CORE" = "true" ]]; then
rm -rf /var/solr/data/$CONFIGSET
fi

# make sure solr.xml exists if volume mounted at /var/solr/data
if [ ! -f "/var/solr/data/solr.xml" ]; then
echo "Adding missing solr.xml to /var/solr/data"
cp /solr.xml /var/solr/data/solr.xml
fi

if [ ! -f "/var/solr/data/$CONFIGSET/core.properties" ]; then
start-local-solr
solr create -c $CONFIGSET -d "/opt/solr/server/solr/configsets/$CONFIGSET" -p 8983
Expand Down
2 changes: 2 additions & 0 deletions solr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" ?>
<solr></solr>