forked from docker/midPoint_container
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Switch RabbitMQ to TIER version
And add the code to create sampleQueue on the first run.
Showing
5 changed files
with
35 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM tier/rabbitmq:latest | ||
|
||
COPY container_files/etc-rabbitmq/* /etc/rabbitmq/ | ||
COPY container_files/usr-local-bin/* /usr/local/bin/ | ||
|
||
ENV RABBITMQ_PID_FILE=/var/run/rabbitmq/pid | ||
|
||
# Must be on /var/lib/rabbitmq (this is the same place where queues are defined) | ||
ENV RABBITMQ_INIT_DONE_FILE=/var/lib/rabbitmq/initialization.done | ||
|
||
ENTRYPOINT ["/usr/local/bin/demo-entrypoint.sh"] | ||
|
||
CMD ["rabbitmq-server"] |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Allow guest access from anywhere (change this in production!) | ||
loopback_users = none |
8 changes: 8 additions & 0 deletions
8
demo/complex/mq/container_files/usr-local-bin/demo-entrypoint.sh
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -e $RABBITMQ_INIT_DONE_FILE ]; then | ||
/usr/local/bin/initialize-rabbitmq.sh & | ||
else | ||
echo "RabbitMQ was already initialized" | ||
fi | ||
/usr/local/bin/entrypoint.sh "$@" |
11 changes: 11 additions & 0 deletions
11
demo/complex/mq/container_files/usr-local-bin/initialize-rabbitmq.sh
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Executing RabbitMQ initialization" | ||
echo "Waiting for the server to start up..." | ||
rabbitmqctl -t 30 wait $RABBITMQ_PID_FILE | ||
echo "OK, creating sampleQueue..." | ||
rabbitmqadmin declare queue name=sampleQueue | ||
echo "Done" | ||
touch $RABBITMQ_INIT_DONE_FILE |