Closed miraculixx closed 8 years ago
You can use the following command to expose the ports to the outside world:
dokku mongo:expose SERVICE
By default, it will pick random ports to expose onto. The order in which the ports correspond to mongodb are thus:
You can also specify the port you wish to expose it on:
dokku mongo:expose SERVICE 1025 1026 1027 1028
Which again correspond to the aforementioned order.
There is no other way to expose an instance outside of the dokku host, nor do I have any desire to make services public by default.
@josegonzalez thank you for the detailed answer, much appreciated
nor do I have any desire to make services public by default.
absolutely agree with this statement. would you consider adding e.g. a --public
option to this and and other plugins' expose
command? alternatively is there a canonical dokku-way to open/close public ports?
The expose command already makes the ports public. Once you run that, you'll be listening to both an internal IP:PORT
as well as 0.0.0.0:SOME_PORT
.
When running dokku mongo:expose
, we now show which ports are exposed where. This information is also available with dokku mongo:info SERVICE --exposed-ports
.
this is related to the closed issues #56 and #39 - however these issues don't specify the specific steps other than using the
expose
command.My scenario is to run multiple mongodbs (i.e. in dokku terms, multiple mongodb instances) on one dokku host. What is the recommended approach to exposing multiple instances to outside of the dokku host?
In light of multiple mongodbs, option 1 seems impractical. I'm very much interested to hear from others about their experiences.