# Use the official RabbitMQ management image as the base FROM rabbitmq:3-management # Dynamically generate configuration in a shell script RUN echo "listeners.tcp.default = 7860" > /etc/rabbitmq/rabbitmq.conf && \ echo "loopback_users = none" >> /etc/rabbitmq/rabbitmq.conf # Set environment variables for the new default user ENV RABBITMQ_DEFAULT_USER=admin ENV RABBITMQ_DEFAULT_PASS=strongpassword # Expose the custom AMQP port and the management UI port EXPOSE 7860 EXPOSE 15672 # Default command to start RabbitMQ CMD ["rabbitmq-server"]