Add Dockerfile for Solr
This commit is contained in:
parent
4946fe2c71
commit
3e123a9a9c
9
solr.sh
Executable file
9
solr.sh
Executable 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
20
solr/Dockerfile
Normal 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"]
|
11
solr/lib/systemd/system/solr.service
Normal file
11
solr/lib/systemd/system/solr.service
Normal 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
|
Loading…
Reference in New Issue
Block a user