<p>I'm facing next problem. I want to run rabbitmq in docker container. When I run docker image with next command:</p>
<p><code>docker run -it --rm  --name rabbit -e RABBITMQ_DEFAULT_USER=aaa -e RABBITMQ_DEFAULT_PASS=aaa -p 5672:5672 -p 15672:15672 rabbitmq:3-management</code></p>
<p>It works just fine.
But I cannot run it in docker-compose. There is my <code>docker-compose.yml</code>:</p>
<pre><code>version: &quot;3&quot;

services:
  rabbitmq3:
    image: rabbitmq:3-management
    container_name: rabbitmq
    environment:
      - RABBITMQ_DEFAULT_USER=aaa
      - RABBITMQ_DEFAULT_PASS=aaa
    ports:
      - 15672:15672
      - 5672:5672
</code></pre>
<p>I use <code>docker-compose up --build</code> command. Logs are ok, but I cannot open rabbitmq at <code>localhost:15672</code>.</p>
<p>Versions are:</p>
<p><code>docker-compose version 1.24.0, build 0aa59064</code></p>
<p><code>Docker version 19.03.5, build 633a0ea838</code></p>
<h3>Edit</h3>
<p>I think, logs are fine, but I'm not sure. Please, check it out <a href="https://gist.github.com/Podidiving/e49c30478c7b30eb445afdc51b5812d2" rel="nofollow noreferrer">here</a></p>

A. Veselev
<p>I'm sorry to bump this one up a year later, but I've just ran into the same problem, so I hope it helps someone anyway :)</p>
<p><strong>TL;DR</strong>
Using the <em>rabbitmq:3-management-alpine</em> image <strong>instead of</strong> <em>rabbitmq:3-management</em> solved this for me.</p>
<p>Here is my <em>docker-compose.yml</em>:</p>
<pre><code>version: &quot;3.9&quot;
services:
  my-rabbit:
    image: rabbitmq:3-management-alpine
    container_name: my-rabbit
    hostname: my-rabbit-host
    ports:
      - &quot;15672:15672&quot;
      - &quot;5672:5672&quot;
    volumes:
      - &quot;./rabbitdata:/var/lib/rabbitmq&quot;
</code></pre>
<p>After running <code>docker compose --detach</code> the management plugin interface and the broker itself become available at http://localhost:15672 (tcp localhost:5672 for broker)</p>
<p><strong>The long story</strong></p>
<p>Using <strong>rabbitmq:3-management</strong> image with docker-compose.yml produces the following output in docker logs:
<a href="https://i.stack.imgur.com/oXHvK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oXHvK.png" alt="Log output for rabbitmq:3-management with docker-compose.yml" /></a></p>
<p>The output stops after the last line</p>
<pre><code>01 19:20:07.852760+00:00 [noti] &lt;0.299.0&gt; WAL: ra_log_wal init, open tbls: ra_log_open_mem_tables, closed tbls: ra_log_closed_mem_tables
</code></pre>
<p>and neither broker nor management plugin are available.</p>
<p>However, after running the following command (using the same arguments as in docker-compose.yml)</p>
<pre><code>docker run -d --hostname my-rabbit-host -p 15672:15672 -p 5672:5672 --name my-rabbit -v rabbitdata:/var/lib/rabbitmq rabbitmq:3-management
</code></pre>
<p>the log actually looks quite different:</p>
<p><a href="https://i.stack.imgur.com/4LLpL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4LLpL.png" alt="Docker log after running rabbitmq:3-management using shell command" /></a></p>
<p>One might notice, that the server is actually started, and after that both broker and management UI become accessible!</p>
<p>Now, if we change the image in docker-compose.yml from <strong>rabbitmq:3-management</strong> to <strong>rabbitmq:3-management-alpine</strong> (see TL;DR example) and run <code>docker compose up --detach</code>, the log output looks pretty much like it was with <code>docker run ... rabbitmq:3-management</code>, and, once again, both broker interface and the management plugin interface work just fine at localhost using ports 5672 and 15672 respectively.</p>
