Skip to content

Commit

Permalink
Merge pull request abernix#40 from jeffhmngi/master
Browse files Browse the repository at this point in the history
Added variables to set DELAY and PORT
  • Loading branch information
arunoda committed Sep 16, 2015
2 parents d6b7caa + 8e0443c commit c3b448d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,31 @@ docker run -d \
meteorhacks/meteord:base
~~~

#### 2.2 With Docker Compose

docker-compose.yml
~~~shell
dashboard:
image: yourrepo/yourapp
ports:
- "80:3000"
links:
- mongo-dev:mongo-dev
environment:
- MONGO_URL=mongodb://mongo-dev/yourapp
- ROOT_URL=http://yourapp.com
- MAIL_URL=smtp://some.mailserver.com:25
- DELAY=30
- PORT=3000
mongo-dev:
image: dfmedia/meteor-mongo:latest
ports:
- "27017:27017"
~~~

When using Docker Compose to start a Meteor container with a Mongo container as well, we need to wait for the database to start up before we try to start the Meteor app, else the container will fail to start.

This sample docker-compose.yml file starts up a container that has used meteorhacks/meterod as its base and a mongo container. It also passes along several variables to Meteor needed to start up, specifies the port number the container will listen on, and waits 30 seconds for the mongodb container to start up before starting up the Meteor container.

#### Rebuilding Binary Modules

Expand Down
7 changes: 7 additions & 0 deletions base/scripts/run_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ if [[ $REBULD_NPM_MODULES ]]; then
fi
fi

# Set a delay to wait to start meteor container
if [[ $DELAY ]]; then
echo "Delaying startup for $DELAY seconds"
sleep $DELAY
fi

# Honour already existing PORT setup
export PORT=${PORT:-80}

echo "=> Starting meteor app on port:$PORT"
node main.js

0 comments on commit c3b448d

Please sign in to comment.