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

Commit

Permalink
user spuervisor as the foreground process
Browse files Browse the repository at this point in the history
  • Loading branch information
tifayuki committed Feb 13, 2015
1 parent cd451b8 commit b2c7fb1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,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 b2c7fb1

Please sign in to comment.