Skip to content

Commit

Permalink
Print usage help on startup, use variable for app port
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed Mar 11, 2024
1 parent 55ab68a commit d7ca967
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions start_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
# `-o pipefail`: Prevent errors in a pipeline (`|`) from being masked
set -uo pipefail

declare -r APP_PORT=8123

# Import environment variables from .env
set -o allexport && source .env && set +o allexport

echo "Starting container for image '$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG', exposing port 8123/tcp"
docker run -p 8123:8123 "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_TAG"

echo "Starting container for image '$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG', exposing port ${APP_PORT}/tcp"
echo "- Run 'curl http://localhost:${APP_PORT}/status' to send a test request to the containerized app."
echo "- Enter Ctrl-C to stop the container."
docker run -p "$APP_PORT:$APP_PORT" "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_TAG"

0 comments on commit d7ca967

Please sign in to comment.