Add Dockerfile for Solr

This commit is contained in:
Disassembler 2017-12-13 10:18:38 +01:00
parent 4946fe2c71
commit 3e123a9a9c
3 changed files with 40 additions and 0 deletions

9
solr.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
SOURCE_DIR=$(realpath $(dirname "${0}"))/solr
# Prepare Docker mount structure
mkdir -p /srv/solr/server/solr
# Build Docker container
docker build -t solr ${SOURCE_DIR}

20
solr/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM alpine:3.7
MAINTAINER Disassembler <disassembler@dasm.cz>
RUN apk --no-cache add openjdk8-jre-base
RUN apk --no-cache add bash lsof \
&& wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz \
&& tar xzf /tmp/solr-6.5.1.tgz -C /srv/ \
&& mv /srv/solr-6.5.1 /srv/solr \
&& rm -f /tmp/solr-6.5.1.tgz \
&& addgroup -S solr \
&& adduser -S -h /srv/solr/data -s /bin/sh -g solr -G solr solr \
&& chown -R solr:solr /srv/solr/ \
&& ln -s /srv/solr/bin/solr /usr/local/bin/solr
VOLUME ["/srv/solr/server/solr"]
EXPOSE 8983
USER solr
CMD ["solr", "start", "-f"]

View File

@ -0,0 +1,11 @@
[Unit]
Description=OpenMapKit Solr container
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/docker run --rm --tmpfs /tmp --name solr -v /srv/solr/server/solr:/srv/solr/server/solr solr
ExecStop=/usr/bin/docker stop solr
[Install]
WantedBy=multi-user.target