Created
August 10, 2019 15:56
-
-
Save alipandidan/af6b0997b2e7570cf2c3aaa642b8d3ec to your computer and use it in GitHub Desktop.
Suitable entrypoint for docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
if [ $(echo "$1" | cut -c1) = "-" ]; then | |
echo "$0: assuming arguments" | |
set -- myapp "$@" | |
fi | |
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "myapp" ]; then | |
echo "$0: setting data directory to $MYAPP_DATA" | |
set -- "$@" -datadir="$MYAPP_DATA" | |
fi | |
if [ "$1" = "myappcli" ] || [ "$1" = "yourappcli" ]; then | |
echo | |
exec gosu myappcli "$@" | |
fi | |
echo | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment