Last active
August 29, 2015 14:05
-
-
Save mfjohansson/4f7fc9999921798cb87c to your computer and use it in GitHub Desktop.
mean.io production
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
##### Install node.js | |
curl -sL https://deb.nodesource.com/setup | sudo bash - | |
sudo apt-get install nodejs |
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
##### Add repo | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
sudo apt-get update | |
##### Install | |
sudo apt-get install mongodb-org | |
##### Start | |
sudo service mongod start | |
##### Remote access | |
sudo nano /etc/mongod.conf | |
# Comment out bind_ip | |
sudo service mongod restart |
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
##### Make sure that the environment variable is set | |
sudo visudo | |
# Add: | |
Defaults env_keep +="NODE_ENV" | |
##### Set environment to production | |
export NODE_ENV=production | |
sudo -E bash -c 'echo $NODE_ENV' | |
##### Prepare resources | |
grunt uglify | |
grunt cssmin | |
##### Start server | |
sudo forever start server.js |
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
##### Install Git | |
sudo apt-get install git | |
##### Install bzip2 (req. by phantomjs) | |
sudo apt-get install bzip2 | |
##### NPM install | |
sudo npm install | |
##### Global modules | |
sudo npm install -g forever | |
sudo npm install -g grunt-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment