diff --git a/docker/rabbitmq/Dockerfile b/docker/rabbitmq/Dockerfile new file mode 100644 index 0000000000..6d976a9552 --- /dev/null +++ b/docker/rabbitmq/Dockerfile @@ -0,0 +1,8 @@ +FROM rhel7 +MAINTAINER Lars Kellogg-Stedman + +RUN yum -y install rabbitmq-server; yum clean all +ADD rabbitmq.config /etc/rabbitmq/ +ADD rabbitmq-env.conf /etc/rabbitmq/ +ADD start.sh /start.sh +CMD ["/start.sh"] diff --git a/docker/rabbitmq/rabbitmq-env.conf b/docker/rabbitmq/rabbitmq-env.conf new file mode 100644 index 0000000000..c2b843e5ed --- /dev/null +++ b/docker/rabbitmq/rabbitmq-env.conf @@ -0,0 +1,3 @@ +RABBITMQ_NODE_PORT=@RABBITMQ_PORT@ +RABBITMQ_LOG_BASE=@RABBITMQ_LOG_BASE@ + diff --git a/docker/rabbitmq/rabbitmq.config b/docker/rabbitmq/rabbitmq.config new file mode 100644 index 0000000000..15a47eba18 --- /dev/null +++ b/docker/rabbitmq/rabbitmq.config @@ -0,0 +1,11 @@ +[ + {rabbit, [ + {default_user, <<"@RABBITMQ_USER@">>}, + {default_pass, <<"@RABBITMQ_PASS@">>} + ]}, + {kernel, [ + + ]} +]. +% EOF + diff --git a/docker/rabbitmq/start.sh b/docker/rabbitmq/start.sh new file mode 100755 index 0000000000..36e6e266a7 --- /dev/null +++ b/docker/rabbitmq/start.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +: ${RABBITMQ_USER:=guest} +: ${RABBITMQ_PASS:=guest} +: ${RABBITMQ_PORT:=5672} +: ${RABBITMQ_LOG_BASE:=/var/log/rabbitmq} + +sed -i ' + s|@RABBITMQ_USER@|'"$RABBITMQ_USER"'|g + s|@RABBITMQ_PASS@|'"$RABBITMQ_PASS"'|g +' /etc/rabbitmq/rabbitmq.config + +sed -i ' + s|@RABBITMQ_PORT@|'"$RABBITMQ_PORT"'|g + s|@RABBITMQ_LOG_BASE@|'"$RABBITMQ_LOG_BASE"'|g +' /etc/rabbitmq/rabbitmq-env.conf + +exec /usr/lib/rabbitmq/bin/rabbitmq-server +