Skip to content

Commit

Permalink
Move APP_PORT setting into .env
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed May 4, 2024
1 parent e167588 commit f7c36bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
# $ DOCKER_IMAGE_NAME="foo/bar" just ...
#

# Docker-related settings
### App-related settings
# APP_PORT must match `quarkus.http.port` setting in `application.properties`.
APP_PORT=8123

### Docker-related settings
DOCKER_IMAGE_NAME="miguno/java-docker-build-tutorial"
DOCKER_IMAGE_TAG="latest"
5 changes: 2 additions & 3 deletions start_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
# `-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

# Force amd64 as the platform. This workaround is needed on Apple Silicon
# machines. Details at https://stackoverflow.com/questions/72152446/.
declare -r DOCKER_OPTIONS="--platform linux/amd64"

# 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 ${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."
Expand Down

0 comments on commit f7c36bc

Please sign in to comment.