mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-21 21:40:48 +02:00
Modify the binstubs to run things in docker
This commit is contained in:
parent
99ef4af3e5
commit
faceaac874
7 changed files with 35 additions and 0 deletions
16
script/docker-environment
Executable file
16
script/docker-environment
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
# Run a command in the app's environment
|
||||
|
||||
set -e
|
||||
|
||||
# Find our app dir and just run the command in we're in the container since the
|
||||
# container is built with an /etc/app-env file inside of it.
|
||||
appdir=$(cd $(dirname "$0")/.. && pwd)
|
||||
[ -f /etc/app-env ] && exec "$@"
|
||||
|
||||
# Otherwise, run docker compose to run our command in the container
|
||||
cmd="$@"; [ "$#" -eq 0 ] && cmd=bash
|
||||
export VOLUME="$appdir:/app"
|
||||
image=${DOCKER_IMAGE:=web}
|
||||
|
||||
exec docker-compose run --rm $image $cmd
|
Loading…
Add table
Add a link
Reference in a new issue