FROM rabbitmq:3.8-management

# Enable necessary plugins
RUN rabbitmq-plugins enable --offline rabbitmq_management
RUN rabbitmq-plugins enable --offline rabbitmq_mqtt
RUN rabbitmq-plugins enable --offline rabbitmq_web_mqtt
RUN rabbitmq-plugins enable --offline rabbitmq_stomp
RUN rabbitmq-plugins enable --offline rabbitmq_web_stomp

# Expose ports
EXPOSE 15672
EXPOSE 5672
EXPOSE 1883

# Copy custom entrypoint script
COPY custom-entrypoint.sh /usr/local/bin/

# Set execute permission for the script
RUN chmod +x /usr/local/bin/custom-entrypoint.sh

# Use custom entrypoint script
ENTRYPOINT ["custom-entrypoint.sh"]

