RabbitMQ integrated in Docker container with Alpine Linux

Béla Tibor Bartha

Technical Lead

Handling high frequency asynchronous events might scream getting them handled with a FIFO queue. RabbitMQ was the solution chosen by us.

Since it needs to be used locally for one micro-service in our code, we decided to use it in the same docker container.

We share the same objectives

Setting up for Bitbucket Pipelines (eg. tests)
Setting up for deployment (Dockerfile)

Since most of our Docker image was already set up, we’re using Alpine Linux.


The below snippet is just for adding the RabbitMQ server startup before starting the application (in fact the -detached parameter is there to ensure that it’s running in background and doesn’t block shell’s execution)


And voilá, there you have it, RabbitMQ in the same container with your code. Of course, in time, when we’re going to do horizontal scaling, this is subject to change.

As an addendum, these helped me to get around and play with Docker (and in the Docker container directly), especially the last one.