diff --git a/Dockerfile b/Dockerfile index f65cd57..fd4e502 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM ubuntu:trusty + MAINTAINER Fernando Mayo # Install RabbitMQ @@ -19,5 +20,5 @@ ADD run.sh /run.sh ADD set_rabbitmq_password.sh /set_rabbitmq_password.sh RUN chmod 755 ./*.sh -EXPOSE 5672 15672 +EXPOSE 5672 15672 4369 25672 CMD ["/run.sh"] diff --git a/README.md b/README.md index 8831cfd..be86929 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ docker run -d \ tutum/rabbitmq ``` -And add `CLUSTER_WITH` for the others nodes : +And add `CLUSTER_WITH` for the others nodes and `NODE_TYPE` : ``` docker run -d \ @@ -77,6 +77,7 @@ docker run -d \ -e HOSTNAME=node2.host.io \ -e RABBITMQ_USE_LONGNAME=true \ -e CLUSTER_WITH=node1.host.io \ + -e NODE_TYPE=ram \ tutum/rabbitmq ``` RabbitMQ cluster stack file with Tutum diff --git a/run.sh b/run.sh index 08607d8..412209c 100755 --- a/run.sh +++ b/run.sh @@ -19,9 +19,17 @@ else /usr/sbin/rabbitmq-server & sleep 10 rabbitmqctl stop_app - rabbitmqctl join_cluster rabbit@$CLUSTER_WITH + if [ -z "$NODE_TYPE" ] ; then + rabbitmqctl join_cluster rabbit@$CLUSTER_WITH + else + rabbitmqctl join_cluster --$NODE_TYPE rabbit@$CLUSTER_WITH + fi rabbitmqctl start_app fg + rabbitmq-plugins disable rabbitmq_managment + rabbitmq-plugins enable rabbitmq_management_agent + /usr/sbin/rabbitmq-server stop fi + /usr/sbin/rabbitmq-server fi