Last active
March 1, 2019 22:07
-
-
Save schnogz/c411f8dc3364920d25edd9775724b787 to your computer and use it in GitHub Desktop.
AWS Beanstalk config files
This file contains hidden or 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
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 |
This file contains hidden or 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
option_settings: | |
aws:elasticbeanstalk:application:environment: | |
PORT: 1771 | |
NPM_USE_PRODUCTION: false | |
aws:elasticbeanstalk:container:nodejs: | |
NodeCommand: "npm run deploy" | |
NodeVersion: 10.15.1 |
This file contains hidden or 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
{ | |
"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", | |
} |
This file contains hidden or 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
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