Deploy React and Node project to Elastic Beanstalk
Sources:
AMS Official docs
How to Log
Very good source with sample project
Extra source
Important Points
tail -n 50 /var/log/web.stdout.log
prints last 50 lines of node terminal outputtail -n 50 eb-engine.log
logs errors before node is startedeb create
creates environmenteb init
initialize an application. Multiple applications can run in one environment..ebignore
ignore files when type ineb deploy
1 | if (process.env.NODE_ENV !== 'development') { |
super important!!! It will run react build folder at nodejs’s port. (8080 or 5000)
Steps
- build a react build with
npm run build
under the react folder (my-app) eb create
code .ebignore
to create ignore file- ignore all the files that mentioned before
eb deploy
赞赏一下