Skip to content

Commit

Permalink
Default API IP to all interfaces in the docker image
Browse files Browse the repository at this point in the history
Otherwise, the API isn't accessible even when ports are forwarded
without manually requesting `--api-ip`

An entrypoint wrapper is used so that only the default behavior is changed,
but `--api-ip` can still be passed to the command.
  • Loading branch information
minrk committed Apr 19, 2017
1 parent 56f63ce commit 1a5db58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ RUN npm install -g

USER nobody

ENTRYPOINT ["configurable-http-proxy"]
ENTRYPOINT ["/srv/configurable-http-proxy/chp-docker-entrypoint"]
12 changes: 12 additions & 0 deletions chp-docker-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Wrapper around CHP entrypoint that changes defaults slightly
# to be more appropriate when run in a container.

if [[ "$@" != *"--api-ip"* ]]; then
# Default api-ip to all interfaces in docker,
# so that it is accessible to other containers
# and when port-forwarding is requested.
ARGS="--api-ip=0.0.0.0"
fi

exec configurable-http-proxy $ARGS $@

0 comments on commit 1a5db58

Please sign in to comment.