dokku / dokku-mongo

a mongo plugin for dokku
MIT License
174 stars 32 forks source link

Exposing mongo instances #56

Closed derekstavis closed 8 years ago

derekstavis commented 8 years ago

Hi! Thanks for such a nice plugin! It's working very well.

I have been trying to expose one of my mongo instances to the internet, but I have not understood why I need to supply 4 ports:

# dokku mongo:expose qa 27017
 !     Service is already started
4 ports to be exposed need to be provided

When the comman description requires only one:

 mongo:expose <name> [port], Expose a MongoDB service on custom port if provided (random port otherwise)

If I provide all 4 ports I get errors about port already being used I get an error:

# dokku mongo:expose qa 27017 27017 27017 27017
 !     Service is already started
docker: Error response from daemon: failed to create endpoint dokku.mongo.qa.ambassador on network bridge: Bind for 0.0.0.0:27017 failed: port is already allocated.
josegonzalez commented 8 years ago

You need to expose them on different ports. In mongo's case, there are 4 ports that need to be exposed, so you need to specify them in order. You can leave them unspecified, and if so they will all be assigned randomly