-
-
Save arunoda/ec00f2989ee09c768c5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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