Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Default Port to be set by ENV Var #449

Closed
shamil614 opened this issue Nov 16, 2020 · 2 comments
Closed

Allow Default Port to be set by ENV Var #449

shamil614 opened this issue Nov 16, 2020 · 2 comments
Labels
Request Request for image modification or feature

Comments

@shamil614
Copy link

shamil614 commented Nov 16, 2020

I had to modify the entrypoint script because it doesn't allow for setting the default port. Obviously for most project and most cases the default port of 5672 is perfect. However the project I'm working on requires the use of a custom and random port. In this particular instance I'm running rabbit on a CI env which allocates random ports to defined ENV vars. I hope that explains the context around the requirement for needing some customization on the ports.

Would you be open to a PR to change this code?
To something like this?

: ${RABBITMQ_NODE_PORT:="5672"}
rabbit_set_config 'listeners.tcp.default' "$RABBITMQ_NODE_PORT"
@tianon
Copy link
Member

tianon commented Nov 16, 2020

See #422 / #424 -- we are much more likely to remove behavior from the entrypoint script than add to it.

What I would suggest is supplying your own configuration snippet that enables the port you desire (rather than relying on the snippet our script currently generates).

@wglambert wglambert added the Request Request for image modification or feature label Nov 16, 2020
@shamil614
Copy link
Author

Oh ok. After taking a second look, I see where I could have done things differently. In short, I can avoid relying on the entrypoint script by adding COPY rabbitmq.conf /etc/rabbitmq/rabbitmq.conf to my dockerfile. Where the rabbitmq.conf file has the contents of

loopback_users.guest = false
management.tcp.port = 15672

Specifically the file does not have listeners.tcp.default = 5672. Which allows the RABBITMQ_NODE_PORT env var to decide the port.

I think initially (it was about a month ago) I thought that I couldn't modify with rabbitmq.conf without breaking the entrypoint script.
Thank you for responding to my request. I very much appreciate all the hard work. 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

3 participants