docs: add a note as to how to specify an interface/ip to bind on when exposing a service

Closes dokku/dokku-mongo#128
This commit is contained in:
Jose Diaz-Gonzalez
2021-09-12 07:09:55 -04:00
parent 2b4ff03bff
commit 0657f47442
2 changed files with 11 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ postgres:destroy <service> [-f|--force] # delete the postgres service
postgres:enter <service> # enter or run a command in a running postgres service container
postgres:exists <service> # check if the postgres service exists
postgres:export <service> # export a dump of the postgres service database
postgres:expose <service> <ports...> # expose a postgres service on custom port if provided (random port otherwise)
postgres:expose <service> <ports...> # expose a postgres service on custom host:port if provided (random port on the 0.0.0.0 interface if otherwise unspecified)
postgres:import <service> # import a dump into the postgres service database
postgres:info <service> [--single-info-flag] # print the service information
postgres:link <service> <app> [--link-flags...] # link the postgres service to the app
@@ -276,7 +276,7 @@ You may also run a command directly against the service. Filesystem changes will
dokku postgres:enter lolipop touch /tmp/test
```
### expose a postgres service on custom port if provided (random port otherwise)
### expose a postgres service on custom host:port if provided (random port on the 0.0.0.0 interface if otherwise unspecified)
```shell
# usage
@@ -289,6 +289,12 @@ Expose the service on the service's normal ports, allowing access to it from the
dokku postgres:expose lolipop 5432
```
Expose the service on the service's normal ports, with the first on a specified ip adddress (127.0.0.1):
```shell
dokku postgres:expose lolipop 127.0.0.1:5432
```
### unexpose a previously exposed postgres service
```shell

View File

@@ -8,9 +8,11 @@ source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
service-expose-cmd() {
#E expose the service on the service's normal ports, allowing access to it from the public interface (0.0.0.0)
#E dokku $PLUGIN_COMMAND_PREFIX:expose lolipop ${PLUGIN_DATASTORE_PORTS[@]}
#E expose the service on the service's normal ports, with the first on a specified ip adddress (127.0.0.1)
#E dokku $PLUGIN_COMMAND_PREFIX:expose lolipop 127.0.0.1:${PLUGIN_DATASTORE_PORTS[@]}
#A service, service to run command against
#A ports, a list of ports to run against
declare desc="expose a $PLUGIN_SERVICE service on custom port if provided (random port otherwise)"
declare desc="expose a $PLUGIN_SERVICE service on custom host:port if provided (random port on the 0.0.0.0 interface if otherwise unspecified)"
local cmd="$PLUGIN_COMMAND_PREFIX:expose" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1" PORTS_LIST=("${@:2}")