Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(serve.sh): add port feature #198

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
# This script runs a "development server" from Docker.
# -----------------------------------------------------------------------------

# capture the first argument as the port, defaulting to 4000
PORT=${1:-4000}
shift

# Build the image (if and only if it is not already built).
if [[ "$(docker images -q aep-site 2> /dev/null)" == "" ]]; then
docker build -t aep-site .
Expand All @@ -27,8 +31,8 @@ fi

# Run the image.
docker run --rm \
-p 4000:4000/tcp -p 4000:4000/udp \
-p "${PORT}:4000/tcp" -p "${PORT}:4000/udp" \
-p 35729:35729/tcp -p 35729:35729/udp \
--mount type=bind,source=`pwd`,destination=/code/,readonly \
--mount "type=bind,source=$(pwd),destination=/code/,readonly" \
aep-site \
"$@"
Loading