This commit is contained in:
Kim Oliver Drechsel 2021-10-28 00:16:45 +02:00
commit 75348a1877
2 changed files with 25 additions and 0 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# entrypoint.sh
## A basic template for docker entrypoint shell scripts

23
entrypoint.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/sh
set -e
trap "echo Exiting...; exit 0" EXIT TERM
STARTUP_COMMAND="java Xmx2G -jar app.jar" # Command that you specified in your Dockerfile as 'CMD'
BASE_DIR="/app" # Base Direcotry of your containerized app
if [[ "$*" == "$STARTUP_COMMAND" ]]; then
if ! [ -d "$BASE_DIR" ]; then
echo "Error: $BASE_DIR is missing. Exiting..."
exit 1
fi
cd "$BASE_DIR"
echo "Starting app..."
exec "$@"
fi
exec "$@"