Skip to content
Permalink
Browse files

added es-snapshot

  • Loading branch information...
ivdelchev committed Mar 4, 2017
1 parent 374ebb0 commit a7c30b9406e95b7b10541c850127856abd7598b4
Showing with 50 additions and 0 deletions.
  1. +6 −0 es-snapshot/Dockerfile
  2. +15 −0 es-snapshot/docker-compose.yml
  3. +29 −0 es-snapshot/docker-entrypoint.sh
@@ -0,0 +1,6 @@
# Set the base image to hnbuzz because it's already set up
FROM elasticsearch:1.7.4

RUN echo 'path.repo: ["/opt/elasticsearch/backup"]' >> /usr/share/elasticsearch/config/elasticsearch.yml

COPY docker-entrypoint.sh /
@@ -0,0 +1,15 @@
version: '2'
services:
es:
build: .
image: leandot-es:1.0.0
ports:
- 9200:9200
volumes:
- leandot-data-prod:/usr/share/elasticsearch/data
- leandot-backup-prod:/opt/elasticsearch/backup
volumes:
leandot-data-prod:
external: true
leandot-backup-prod:
external: true
@@ -0,0 +1,29 @@
#!/bin/bash

set -e

# Add elasticsearch as command if needed
if [ "${1:0:1}" = '-' ]; then
set -- elasticsearch "$@"
fi

# Drop root privileges if we are running elasticsearch
# allow the container to be started with `--user`
if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then
# Change the ownership of user-mutable directories to elasticsearch
for path in \
/usr/share/elasticsearch/data \
/usr/share/elasticsearch/logs \
/opt/elasticsearch/backup \
; do
chown -R elasticsearch:elasticsearch "$path"
done

set -- gosu elasticsearch "$@"
#exec gosu elasticsearch "$BASH_SOURCE" "$@"
fi

# As argument is not related to elasticsearch,
# then assume that user wants to run his own process,
# for example a `bash` shell to explore this image
exec "$@"

0 comments on commit a7c30b9

Please sign in to comment.
You can’t perform that action at this time.