Elastic Beanstalk: http://inshatan-cart-api-dev.eu-west-1.elasticbeanstalk.com/
Frontend application: https://d2v14ttltat414.cloudfront.net
FE Pull Request: inshatan/nodejs-aws-fe#6
BE Pull Request: inshatan/nodejs-aws-be#6
- 1 - Dockerfile is prepared, image is building. Image size is minimised to be less than 500 MB. Image size is equal to 102 MB
- 2 - Dockerfile is optimized. Files that change more often and commands that depend on them should be included later, files and commands that change less should be at the top.
- 3 - Folders are added to .dockerignore, with explanations. At least 2 big directories should be excluded from build context. Elastic Beanstalk application is initialized.
- 4 - Environment is created and the app is deployed to the AWS cloud. You must provide a link to your GitHub repo with Cart API service or PR with created Dockerfile and related configurations.
- 5 - FE application is updated with Cart API endpoint. You must provide a PR with updates in your FE repository and OPTIONALLY link to deployed front-end app which makes proper API calls to your Cart service.
- Add .dockerignore file to minimize build context. Files and folders generated by the application or npm should be excluded. Provide explanations to why the folder was ignored.
- OPTIONAL: add more folders to .dockerignore with explanations
- Minimize docker image size by applying techniques found in the lecture to be less than 500 MB.
- OPTIONAL: Minimize docker image size to about 100 MB.
- Optimize image build times. Dockerfile commands that run npm install should not depend on typescript files.
- OPTIONAL: Optimize build times by utilizing multistage builds.
- OPTIONAL: Lint Dockerfile.
Deploy Cart API service with Elastic Beanstalk.
- Use a Dockerfile from TASK 8.1 to deploy your Cart API using AWS EB CLI.
- Initiate an Elastic beanstalk application using the eb init command. Application name must follow the following convention {yours_github_account_login}-cart-api.
- Create a new environment using the eb create command. An environment name must be short but not less then four signs (e.g develop, test, prod, etc). Use the --cname option {yours_github_account_login}-cart-api-{environment_name} so that Elastic Beanstalk will use it to create a proper domain name. Use the --singe option to not use any Load Balancer for this environment.
- Investigate AWS Elastic Beanstalk service in the AWS Console. Walk through EC2 resources that were created by Elastic Beanstalk
- Update the app and deploy changes using the eb deploy command.
- Update FE app: pull the latest version of the app from repo and replace {cart} API placeholder in src/constants/apiPaths.ts using a Cart API url you get after successful deployment. Make sure your app starts to call Cart API when you add or remove items. Now after page refresh cart’s content might remain the same.