Skip to content

Commit 3f0b814

Browse files
Make Docker Compose an option for running a node for tests
1 parent 73b7c97 commit 3f0b814

18 files changed

+98
-17
lines changed

.travis/etc/rabbitmq.conf

-16
This file was deleted.

.travis/etc/rabbitmq.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker/rabbitmq.conf

CONTRIBUTING.md

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ is used by CI and can be used as example:
6262

6363
``` ini
6464
listeners.tcp.1 = 0.0.0.0:5672
65-
listeners.tcp.2 = 0.0.0.0:5674
6665

6766
listeners.ssl.default = 5671
6867

TestCertificates

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker/certificates

docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.7'
2+
services:
3+
rabbitmq:
4+
build: ./docker
5+
container_name: rabbitmq_objc_client
6+
environment:
7+
RABBITMQ_LOGS: '-'
8+
RABBITMQ_SASL_LOGS: '-'
9+
ports:
10+
- 5671-5672:5671-5672
11+
- 15672:15672

docker/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ubuntu:18.04
2+
3+
RUN apt-get update -y
4+
RUN apt-get install -y gnupg2 wget
5+
RUN wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | apt-key add -
6+
7+
COPY apt/sources.list.d/bintray.rabbitmq.list /etc/apt/sources.list.d/bintray.rabbitmq.list
8+
COPY apt/preferences.d/erlang /etc/apt/preferences.d/erlang
9+
10+
RUN apt-get update -y
11+
12+
RUN apt-get upgrade -y && \
13+
apt-get install -y rabbitmq-server
14+
15+
COPY docker-entrypoint.sh /
16+
COPY certificates/*.pem /etc/rabbitmq/
17+
COPY rabbitmq.conf /etc/rabbitmq/rabbitmq.conf
18+
19+
ENTRYPOINT /docker-entrypoint.sh
20+
21+
EXPOSE 5671 5672 15672

docker/apt/preferences.d/erlang

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Package: erlang*
2+
Pin: release o=Bintray
3+
Pin-Priority: 1000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deb http://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
2+
deb http://dl.bintray.com/rabbitmq/debian bionic main
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docker/docker-entrypoint.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
server=rabbitmq-server
3+
ctl=rabbitmqctl
4+
plugins=rabbitmq-plugins
5+
delay=5
6+
7+
$server -detached
8+
9+
echo "Waiting $delay seconds for RabbitMQ to start."
10+
11+
sleep $delay
12+
13+
$ctl add_vhost "vhost/with/a/few/slashes"
14+
$ctl add_user "O=client,CN=guest" bunnies
15+
$ctl set_permissions "O=client,CN=guest" ".*" ".*" ".*"
16+
17+
$plugins enable rabbitmq_auth_mechanism_ssl
18+
$plugins enable rabbitmq_management
19+
$ctl eval 'supervisor2:terminate_child(rabbit_mgmt_sup_sup, rabbit_mgmt_sup), application:set_env(rabbitmq_management, sample_retention_policies, [{global, [{605, 1}]}, {basic, [{605, 1}]}, {detailed, [{10, 1}]}]), rabbit_mgmt_sup_sup:start_child().'
20+
$ctl eval 'supervisor2:terminate_child(rabbit_mgmt_agent_sup_sup, rabbit_mgmt_agent_sup), application:set_env(rabbitmq_management_agent, sample_retention_policies, [{global, [{605, 1}]}, {basic, [{605, 1}]}, {detailed, [{10, 1}]}]), rabbit_mgmt_agent_sup_sup:start_child().'
21+
22+
$ctl shutdown --timeout $delay
23+
24+
echo 'Starting RabbitMQ in the foreground (Ctrl-C to stop)'
25+
26+
exec $server

docker/rabbitmq.conf

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
listeners.tcp.1 = 0.0.0.0:5672
2+
3+
listeners.ssl.default = 5671
4+
5+
ssl_options.cacertfile = /etc/rabbitmq/ca_certificate.pem
6+
ssl_options.certfile = /etc/rabbitmq/server_certificate.pem
7+
ssl_options.keyfile = /etc/rabbitmq/server_key.pem
8+
ssl_options.verify = verify_peer
9+
ssl_options.fail_if_no_peer_cert = false
10+
11+
ssl_options.honor_cipher_order = true
12+
ssl_options.honor_ecc_order = true
13+
ssl_options.client_renegotiation = false
14+
ssl_options.secure_renegotiate = true
15+
16+
ssl_options.ciphers.1 = ECDHE-ECDSA-AES256-GCM-SHA384
17+
ssl_options.ciphers.2 = ECDHE-RSA-AES256-GCM-SHA384
18+
ssl_options.ciphers.3 = ECDH-ECDSA-AES256-GCM-SHA384
19+
ssl_options.ciphers.4 = ECDH-RSA-AES256-GCM-SHA384
20+
ssl_options.ciphers.5 = DHE-RSA-AES256-GCM-SHA384
21+
ssl_options.ciphers.6 = DHE-DSS-AES256-GCM-SHA384
22+
ssl_options.ciphers.7 = ECDHE-ECDSA-AES128-GCM-SHA256
23+
ssl_options.ciphers.8 = ECDHE-RSA-AES128-GCM-SHA256
24+
ssl_options.ciphers.9 = ECDH-ECDSA-AES128-GCM-SHA256
25+
ssl_options.ciphers.10 = ECDH-RSA-AES128-GCM-SHA256
26+
ssl_options.ciphers.11 = DHE-RSA-AES128-GCM-SHA256
27+
ssl_options.ciphers.12 = DHE-DSS-AES128-GCM-SHA256
28+
29+
auth_mechanisms.1 = PLAIN
30+
auth_mechanisms.2 = AMQPLAIN
31+
auth_mechanisms.3 = EXTERNAL
32+
33+
loopback_users = none

0 commit comments

Comments
 (0)