Skip to content

Instantly share code, notes, and snippets.

@arunoda

arunoda/start.sh Secret

Created November 14, 2013 06:03
Show Gist options
  • Save arunoda/ec00f2989ee09c768c5d to your computer and use it in GitHub Desktop.
Save arunoda/ec00f2989ee09c768c5d to your computer and use it in GitHub Desktop.
#!/bin/bash
#setting up the mongodb
if [[ "$MONGO_URL" != "" ]]; then
#if the MONGO_URL provided via an env variable use that
echo "[Mongo] Using MONGO_URL";
elif [[ "$MONGO_PORT_27017_TCP_ADDR" != "" ]]; then
#if there is an mongo container linked, use it
echo "[Mongo] Using a linked Mongo container"
export MONGO_URL="mongodb://$MONGO_PORT_27017_TCP_ADDR/ocb"
else
#otherwise start an local mongo server
echo "[Mongo] Using local mongodb server(not recommended)"
mongod &
sleep 5
fi
#starting the app
cd app
NODE_ENV=production node server.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment