You have not mounted config files and if you want to persist messages you will need to mount a volume too
I have a perfectly working rabbitmq docker running on production, try below configuration , make sure you create your on rabbitmq.config and definations.json
version: '2.4'
services:
rabbitmq:
logging:
driver: json-file
options:
max-size: "2m"
volumes:
- ./rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro
- ./definitions.json:/etc/rabbitmq/definitions.json:ro
- /newvolume/rdata:/var/lib/rabbitmq
container_name: rabbitmq
hostname: rabbitmq
ports:
- 5672:5672
- 15672:15672
image: rabbitmq:3-management
networks:
- xtnet
networks:
xtnet:
external: true