mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00

Allows two things: 1. Access a running server from outside the docker container 2. Run both a console and a server at the same time, for debugging or whatever else.
17 lines
584 B
Bash
Executable file
17 lines
584 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}
|
|
|
|
port_publish=""; [ "${BIND_DOCKER_SERVICE_PORTS:-}" = 1 ] && port_publish="--service-ports"
|
|
exec docker-compose run $port_publish --rm $image $cmd
|