Publish ports based on environment variable

Allows two things:

1. Access a running server from outside the docker container
2. Run both a console and a server at the same time, for debugging or
whatever else.
This commit is contained in:
Matt Rogers 2018-07-21 10:18:31 -05:00
parent b0993b0c76
commit ec2b6cf22e
No known key found for this signature in database
GPG key ID: 605D017C07EB4316

View file

@ -13,4 +13,5 @@ cmd="$@"; [ "$#" -eq 0 ] && cmd=bash
export VOLUME="$appdir:/app"
image=${DOCKER_IMAGE:=web}
exec docker-compose run --rm $image $cmd
port_publish=""; [ "${BIND_DOCKER_SERVICE_PORTS:-}" = 1 ] && port_publish="--service-ports"
exec docker-compose run $port_publish --rm $image $cmd