diff --git a/script/console b/script/console new file mode 100755 index 00000000..ff671891 --- /dev/null +++ b/script/console @@ -0,0 +1,7 @@ +#!/bin/sh + +appdir=$(cd $(dirname "$0")/.. && pwd) +[ -f /etc/app-env ] || exec "$appdir/script/docker-environment" $0 $@ + +export RAILS_ENV='development' +bin/rails console diff --git a/script/docker-environment b/script/docker-environment index a1ee4736..423122d6 100755 --- a/script/docker-environment +++ b/script/docker-environment @@ -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 diff --git a/script/server b/script/server new file mode 100755 index 00000000..59d2d32b --- /dev/null +++ b/script/server @@ -0,0 +1,7 @@ +#!/bin/sh + +export BIND_DOCKER_SERVICE_PORTS=1 +appdir=$(cd $(dirname "$0")/.. && pwd) +[ -f /etc/app-env ] || exec "$appdir/script/docker-environment" $0 $@ + +bin/rails server -b 0.0.0.0