-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize redis cluster during build
- Loading branch information
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ FROM phusion/baseimage:0.9.16 | |
|
||
MAINTAINER Luigis Box <[email protected]> | ||
|
||
CMD ["/sbin/my_init"] | ||
|
||
RUN add-apt-repository -y ppa:rwky/redis | ||
RUN apt-get update -qq && apt-get install -qq redis-server | ||
|
||
|
@@ -30,4 +28,13 @@ ADD /nodes/8003/start.sh /etc/service/redis-8003/run | |
ADD /nodes/8004/start.sh /etc/service/redis-8004/run | ||
ADD /nodes/8005/start.sh /etc/service/redis-8005/run | ||
|
||
RUN apt-get install -qq ruby | ||
RUN gem install redis --no-ri --no-rdoc | ||
ADD bootstrap.sh /bootstrap.sh | ||
ADD redis-trib.rb /redis-trib.rb | ||
|
||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN /sbin/my_init -- /bootstrap.sh | ||
|
||
CMD ["/sbin/my_init"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/sh | ||
echo "yes" | ruby redis-trib.rb create --replicas 1 127.0.0.1:8000 127.0.0.1:8001 127.0.0.1:8002 127.0.0.1:8003 127.0.0.1:8004 127.0.0.1:8005 | ||
echo "Creating redis cluster..." | ||
echo "yes" | ruby /redis-trib.rb create --replicas 1 127.0.0.1:8000 127.0.0.1:8001 127.0.0.1:8002 127.0.0.1:8003 127.0.0.1:8004 127.0.0.1:8005 |