Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
tifayuki committed Feb 13, 2015
2 parents 4dd53de + b2c7fb1 commit 40f74a3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
FROM ubuntu:trusty
FROM tutum/curl:trusty
MAINTAINER Israel Gayoso [email protected]

# Update the APT cache, add basho's repository and install packages
RUN sed -i.bak 's/main$/main universe/' /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y apt-transport-https openssl pwgen
RUN curl https://packagecloud.io/gpg.key | apt-key add -
RUN apt-get update
RUN apt-get install -y apt-transport-https supervisor openssl pwgen
RUN echo "deb https://packagecloud.io/basho/riak/ubuntu/ trusty main" >> /etc/apt/sources.list.d/basho.list
RUN echo "deb-src https://packagecloud.io/basho/riak/ubuntu/ trusty main" >> /etc/apt/sources.list.d/basho.list

# Add riak's repository and install
ADD ./basho.apt.key /tmp/basho.apt.key
RUN apt-key add /tmp/basho.apt.key && rm /tmp/basho.apt.key
RUN echo "deb https://packagecloud.io/basho/riak/ubuntu/ trusty main" > /etc/apt/sources.list.d/basho.list
RUN apt-get update && apt-get install riak
RUN apt-get update
RUN apt-get install -y riak

# Riak's config
ENV RIAK_NODE_NAME "127.0.0.1"
Expand All @@ -22,6 +20,8 @@ ADD ./run.sh /run.sh
ADD ./set_riak_password.sh /set_riak_password.sh
ADD ./create_certificate.sh /create_certificate.sh

ADD supervisord-riak.conf /etc/supervisor/conf.d/supervisord-riak.conf

# Expose protocol buffers and HTTPS
EXPOSE 8087 8098

Expand Down
11 changes: 7 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/bin/bash

set -m

# Generate certificate
if [ ! -f /.certificate_created ]; then
/create_certificate.sh
fi

# Start riak
/usr/sbin/riak start
#/etc/init.d/riak start
supervisord -n &

# Generate riak user
if [ ! -f /.riak_password_set ]; then
/set_riak_password.sh
fi

# Atach to riak console or show log for don't stop container
tail -f /var/log/riak/*.log
# Print riak logs to stdout
tail -F /var/log/riak/*.log &

fg %1
8 changes: 8 additions & 0 deletions supervisord-riak.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[supervisord]
nodaemon=true

[program:riak]
command=bash -c "/usr/sbin/riak console"
numprocs=1
autostart=true
autorestart=true

0 comments on commit 40f74a3

Please sign in to comment.