title: RabbitMQ With With Docker Compose rabbitmq.config file gets replaced on Run
body: <p>i have tried this a number of times and every time i run <code>docker-compose up</code> my rabbitmq.config file gets replaced.</p>
  
  <p>The following is my dockerfile.</p>
  
  <pre><code>FROM rabbitmq:3.6.11-managment
  RUN rabbitmq-plugins enable rabbitmq_management
  RUN rabbitmq-plugins list
  COPY  ./config/rabbitmq.config ../../etc/rabbitmq/ 
  COPY  ./config/test.json ../../etc/rabbitmq/ 
  </code></pre>
  
  <p>and this is my Docker-Compose File.</p>
  
  <pre><code>version: '2'
  services:
    rabbit:
      build:
        context: .
        dockerfile: rabbit.dockerfile
      container_name: rabbit
      hostname: lightrabbit    
      networks:
        - rabnet
      environment:
        - RABBITMQ_DEFAULT_USER=abcd
        - RABBITMQ_DEFAULT_PASS=pass    
      volumes:
        - ./config/rabbitmq:/etc/rabbitmq:rw
        - ./data:/var/lib/rabbitmq:rw
        - ./logs:/var/log/rabbitmq:rw
      ports:
        - 15672:15672  
        - 5672:5672
  volumes:
    rabbitdata:
      driver: local
  networks:
      rabnet:
          driver: bridge
  </code></pre>
  
  <p>I even added a volume mapping to the folder to test it.
  The Reasons i am running <code>RUN rabbitmq-plugins enable rabbitmq_management</code> in my dockerfile is because management plugin is not enabled by default.</p>