Skip to content

Instantly share code, notes, and snippets.

@schnogz
Last active March 1, 2019 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schnogz/c411f8dc3364920d25edd9775724b787 to your computer and use it in GitHub Desktop.
Save schnogz/c411f8dc3364920d25edd9775724b787 to your computer and use it in GitHub Desktop.
AWS Beanstalk config files
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/00_set_tmp_permissions.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
chown -R nodejs:nodejs /tmp/.npm
option_settings:
aws:elasticbeanstalk:application:environment:
PORT: 1771
NPM_USE_PRODUCTION: false
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "npm run deploy"
NodeVersion: 10.15.1
{
"predeploy": "npm install",
"deploy": "cross-env-shell NODE_ENV=production webpack-cli --config ./config/webpack.prod.config.js --display-error-details",
"postdeploy": "node prodServer.js",
}
const express = require('express')
const app = express()
app.set('port', (process.env.PORT || 1771))
app.use(express.static('dist'))
app.listen(app.get('port'), () => {
console.log('Express server has started! http://localhost:' + app.get('port') + '/')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment