initial
This commit is contained in:
commit
75348a1877
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# entrypoint.sh
|
||||
## A basic template for docker entrypoint shell scripts
|
23
entrypoint.sh
Normal file
23
entrypoint.sh
Normal 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 "$@"
|
Loading…
x
Reference in New Issue
Block a user