2018-04-27 09:13:35 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-07-19 23:06:26 +03:00
|
|
|
docker_compose="docker-compose --file docker-compose.yml"
|
|
|
|
|
2020-07-19 18:07:23 +03:00
|
|
|
# Find our app dir
|
|
|
|
appdir=$(cd $(dirname "$0")/.. && pwd)
|
|
|
|
|
2020-07-19 17:20:35 +03:00
|
|
|
# Check if we've been told to run the command in Docker Composer.
|
2018-04-27 09:13:35 -05:00
|
|
|
cmd="$@"; [ "$#" -eq 0 ] && cmd=bash
|
2020-07-19 21:44:43 +03:00
|
|
|
export VOLUME="$appdir"
|
2018-04-27 09:13:35 -05:00
|
|
|
image=${DOCKER_IMAGE:=web}
|
|
|
|
|
2018-07-21 10:18:31 -05:00
|
|
|
port_publish=""; [ "${BIND_DOCKER_SERVICE_PORTS:-}" = 1 ] && port_publish="--service-ports"
|
2020-07-19 23:06:26 +03:00
|
|
|
exec $docker_compose run $port_publish --rm $image $cmd
|