Skip to content

Commit

Permalink
Use variable for 8123 port setting
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed Mar 11, 2024
1 parent fb4017f commit f611312
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 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"
echo "- Run 'curl http://localhost:8123/status' to send a test request to the containerized app."
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 8123:8123 "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_TAG"
docker run -p "$APP_PORT:$APP_PORT" "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_TAG"

0 comments on commit f611312

Please sign in to comment.