Merge pull request #2111 from TracksApp/use-scripts-for-more-operations

Remove some friction when running in development
This commit is contained in:
Matt Rogers 2018-07-21 10:33:34 -05:00 committed by GitHub
commit 3059a273a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

7
script/console Executable file
View file

@ -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

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

7
script/server Executable file
View file

@ -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