use env variables for eb deployment
parent
9c6c841957
commit
a7f2ef90d4
|
@ -18,5 +18,3 @@ lib-cov
|
|||
*.out
|
||||
*.pid
|
||||
package-lock.json
|
||||
ecosystem.config.js
|
||||
knexfile.js
|
||||
|
|
10
README.md
10
README.md
|
@ -25,7 +25,7 @@ npm i
|
|||
|
||||
2. Create config files
|
||||
```
|
||||
touch knexfile.js ecosystem.config.js config/local.js
|
||||
touch config/local.js
|
||||
```
|
||||
|
||||
3. Add database info to knexfile and pm2 ecosystem
|
||||
|
@ -109,4 +109,10 @@ eb deploy environment_name
|
|||
```
|
||||
|
||||
3. Configure environment variables on elastic beanstalk
|
||||
|
||||
```
|
||||
PASSPORT_GOOGLE_ID
|
||||
PASSPORT_GOOGLE_SECRET
|
||||
PASSPORT_GITHUB_ID
|
||||
PASSPORT_GITHUB_SECRET
|
||||
DATABASE_CONNECTION
|
||||
```
|
||||
|
|
|
@ -10,12 +10,18 @@ module.exports.passport = {
|
|||
strategy: require('passport-google-oauth20').Strategy,
|
||||
protocol: 'oauth2',
|
||||
callback: '/auth/google/callback',
|
||||
options: {}
|
||||
options: {
|
||||
clientID: process.env.PASSPORT_GOOGLE_ID,
|
||||
clientSecret: process.env.PASSPORT_GOOGLE_SECRET
|
||||
}
|
||||
},
|
||||
github: {
|
||||
strategy: require('passport-github2').Strategy,
|
||||
protocol: 'oauth2',
|
||||
callback: '/auth/github/callback',
|
||||
options: {}
|
||||
options: {
|
||||
clientID: process.env.PASSPORT_GITHUB_ID,
|
||||
clientSecret: process.env.PASSPORT_GITHUB_SECRET
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
module.exports = {
|
||||
apps: [{
|
||||
name: 'roe-base',
|
||||
script: 'app.js',
|
||||
instances: 1,
|
||||
autorestart: true,
|
||||
watch: false,
|
||||
env: {
|
||||
NODE_ENV: 'development'
|
||||
},
|
||||
env_production: {
|
||||
NODE_ENV: 'production',
|
||||
SAILS_DATASTORE_URL: process.env.DATABASE_CONNECTION
|
||||
}
|
||||
}]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
module.exports = {
|
||||
client: 'pg',
|
||||
connection: process.env.DATABASE_CONNECTION
|
||||
}
|
Loading…
Reference in New Issue