Skip to content

Commit

Permalink
Merge pull request #28 from DispatchMe/custom-port
Browse files Browse the repository at this point in the history
Allow custom server port
  • Loading branch information
chriswessels authored Nov 24, 2016
2 parents 4186d3b + 85eff5f commit 1af4009
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ Assuming you have Docker running, you can build an image of your Meteor.js app b

## Running your app image

The root process of the image will be set to the Node.js entrypoint for your Meteor application, so you can pass runtime settings straight into `docker run -e`, or bake them into your image with `ENV` directives in your Dockerfile. Node.js will listen on port 80 inside the container, but you can bind this to any port on the host.
The root process of the image will be set to the Node.js entrypoint for your Meteor application, so you can pass runtime settings straight into `docker run -e`, or bake them into your image with `ENV` directives in your Dockerfile.

Node.js will listen on port 80 inside the container, but you can bind this to any port on the host. You can also specify a different internal port if you need to like this:

FROM quay.io/chriswessels/meteor-tupperware
ENV PORT=8080

Example of passing options into `docker run` at runtime:

Expand Down
6 changes: 4 additions & 2 deletions includes/scripts/start_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ if [ ! -f $OUTPUT_DIR/bundle/main.js ]; then
exit 1
fi

export PORT=80
if [ -z "$PORT" ]; then
export PORT=80
fi

if [ -z "$NODE_ENV" ]; then
export NODE_ENV="production"
Expand All @@ -19,6 +21,6 @@ if [ -z "$METEOR_ENV" ]; then
export METEOR_ENV="production"
fi

echo "[-] meteor-tupperware is starting your application with NODE_ENV=$NODE_ENV and METEOR_ENV=$METEOR_ENV..."
echo "[-] meteor-tupperware is starting your application with NODE_ENV=$NODE_ENV and METEOR_ENV=$METEOR_ENV on port $PORT..."

exec node $OUTPUT_DIR/bundle/main.js "$@"

0 comments on commit 1af4009

Please sign in to comment.