mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
16 lines
478 B
Bash
Executable file
16 lines
478 B
Bash
Executable file
#!/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
|