Skip to content

Commit

Permalink
Initial working version
Browse files Browse the repository at this point in the history
  • Loading branch information
KensoDev committed Jul 14, 2015
1 parent 39104b7 commit 34cafa8
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:utopic
MAINTAINER Avi Tzuel <[email protected]>

ENV KIBANA_USER kibana
ENV KIBANA_PASSWORD kibana
ENV KIBANA_VERSION 4.1.1

RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install wget nginx-full apache2-utils supervisor && apt-get clean

WORKDIR /opt
RUN wget --no-check-certificate -O- https://download.elastic.co/kibana/kibana/kibana-$KIBANA_VERSION-linux-x64.tar.gz | tar xvfz -
RUN mkdir /etc/kibana

ADD ./templates/nginx/kibana /etc/nginx/sites-available/kibana
ADD ./templates/supervisord.conf /etc/supervisor/conf.d/kibana.conf

RUN rm /etc/nginx/sites-enabled/*
RUN echo "daemon off;" >> /etc/nginx/nginx.conf

EXPOSE 80

ADD run.sh ./run.sh
RUN chmod +x ./run.sh
CMD ./run.sh
6 changes: 6 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo "HOSTNAME: $HOSTNAME"
htpasswd -bc /etc/kibana/htpasswd ${KIBANA_USER} ${KIBANA_PASSWORD}
ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana
sed -i "s/localhost:9200/es:9200/g" /opt/kibana-$KIBANA_VERSION-linux-x64/config/kibana.yml
sed -i "s/kibana:5601/$HOSTNAME:5601/g" /etc/nginx/sites-enabled/kibana
/usr/bin/supervisord -c /etc/supervisor/conf.d/kibana.conf
22 changes: 22 additions & 0 deletions templates/nginx/kibana
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6

# Make site accessible from http://localhost/
server_name localhost;

error_log /dev/stdout info;

location = /health {
return 200;
access_log off;
}

location / {
proxy_pass http://kibana:5601;
proxy_read_timeout 90;

auth_basic "Restricted";
auth_basic_user_file /etc/kibana/htpasswd;
}
}
10 changes: 10 additions & 0 deletions templates/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[supervisord]
nodaemon=true

[program:kibana]
command=/opt/kibana-4.1.1-linux-x64/bin/kibana
autorestart=true

[program:nginx]
command=/usr/sbin/nginx
autorestart=true

0 comments on commit 34cafa8

Please sign in to comment.