added PM2 config file

This commit is contained in:
David Baldwynn 2016-04-12 00:35:28 -04:00
parent 401b1b3d89
commit 29a69b6166
5 changed files with 40 additions and 4 deletions

5
.env Normal file
View File

@ -0,0 +1,5 @@
MAILER_FROM=noreply@tellform.com
MAILER_SERVICE_PROVIDER=Mandrill
MAILER_EMAIL_ID=hackouver@gmail.com
MAILER_PASSWORD=AVCCf1C2dFlrNhx9Iyi_yQ
BASE_URL=159.203.42.158:3000

5
.prod.env Normal file
View File

@ -0,0 +1,5 @@
MAILER_FROM=noreply@tellform.com
MAILER_SERVICE_PROVIDER=Mandrill
MAILER_EMAIL_ID=hackouver@gmail.com
MAILER_PASSWORD=AVCCf1C2dFlrNhx9Iyi_yQ
BASE_URL=stage.tellform.com

View File

@ -5,10 +5,11 @@ module.exports = {
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
options: {
user: 'admin',
pass: process.env.MONGOLAB_PASS || 'admin'
user: '',
pass: process.env.MONGOLAB_PASS || ''
}
},
port: 4545,
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
format: 'combined',

20
ecosystem.json Normal file
View File

@ -0,0 +1,20 @@
{
"apps" : [{
"name" : "tellform",
"script" : "/usr/bin/grunt",
"args" : "['production']"
}],
"deploy" : {
"production" : {
"user" : "node",
"host" : "localhost",
"ref" : "origin/master",
"repo" : "git@github.com:whitef0x0/tellform.git",
"path" : "/opt/deploy",
"post-deploy" : "npm install && bower install --allow-root && pm2 startOrRestart ecosystem.json --env production",
"env" : {
"NODE_ENV": "production"
}
}
}
}

View File

@ -147,10 +147,14 @@ module.exports = function(grunt) {
NODE_ENV: 'test',
},
secure: {
NODE_ENV: 'secure'
NODE_ENV: 'secure',
src: '.env'
},
default: {
src: '.env'
},
production: {
src: '.prod.env'
}
},
mochaTest: {
@ -283,7 +287,8 @@ module.exports = function(grunt) {
// Default task(s).
grunt.registerTask('default', ['lint', 'html2js:main', 'env:default', 'concurrent:default']);
grunt.registerTask('default', ['lint', 'html2js:main', 'uglify:production', 'cssmin', 'ngAnnotate', 'env:production', 'concurrent:default']);
// Debug task.
grunt.registerTask('debug', ['lint', 'html2js:main', 'concurrent:debug']);