Skip to content

psharma-ii/docker-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

yarn eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

yarn build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

AWS Configuration Cheat Sheet updated 4-19-2021

This lecture note is not intended to be a replacement for the videos, but to serve as a cheat sheet for students who want to quickly run thru the AWS configuration steps or easily see if they missed a step. It will also help navigate through the changes to the AWS UI since the course was recorded.

Initial Setup

  1. Go to AWS Management Console

  2. Search for Elastic Beanstalk in "Find Services"

  3. Click the "Create Application" button

  4. Enter "docker" for the Application Name

  5. Scroll down to "Platform" and select "Docker" from the dropdown list.

  6. Change "Platform Branch" to Docker running on 64bit Amazon Linux

  7. Click "Create Application"

  8. You should see a green checkmark after some time.

  9. Click the link above the checkmark for your application. This should open the application in your browser and display a Congratulations message.

Change from Micro to Small instance type:

Note that a t2.small is outside of the free tier. t2 micro has been known to timeout and fail during the build process.

  1. In the left sidebar under Docker-env click "Configuration"

  2. Find "Capacity" and click "Edit"

  3. Scroll down to find the "Instance Type" and change from t2.micro to t2.small

  4. Click "Apply"

  5. The message might say "No Data" or "Severe" in Health Overview before changing to "Ok"

Add AWS configuration details to .travis.yml file's deploy script

  1. Set the region. The region code can be found by clicking the region in the toolbar next to your username.

eg: 'us-east-1'

  1. app should be set to the Application Name (Step #4 in the Initial Setup above)

eg: 'docker'

  1. env should be set to the lower case of your Beanstalk Environment name.

eg: 'docker-env'

  1. Set the bucket_name. This can be found by searching for the S3 Storage service. Click the link for the elasticbeanstalk bucket that matches your region code and copy the name.

eg: 'elasticbeanstalk-us-east-1-923445599289'

  1. Set the bucket_path to 'docker'

  2. Set access_key_id to $AWS_ACCESS_KEY

  3. Set secret_access_key to $AWS_SECRET_KEY

Create an IAM User

  1. Search for the "IAM Security, Identity & Compliance Service"

  2. Click "Create Individual IAM Users" and click "Manage Users"

  3. Click "Add User"

  4. Enter any name you’d like in the "User Name" field.

eg: docker-react-travis-ci

  1. Tick the "Programmatic Access" checkbox

  2. Click "Next:Permissions"

  3. Click "Attach Existing Policies Directly"

  4. Search for "beanstalk"

  5. Tick the box next to "AdministratorAccess-AWSElasticBeanstalk"

  6. Click "Next:Tags"

  7. Click "Next:Review"

  8. Click "Create user"

  9. Copy and / or download the Access Key ID and Secret Access Key to use in the Travis Variable Setup.

Travis Variable Setup

  1. Go to your Travis Dashboard and find the project repository for the application we are working on.

  2. On the repository page, click "More Options" and then "Settings"

  3. Create an AWS_ACCESS_KEY variable and paste your IAM access key from step #13 above.

  4. Create an AWS_SECRET_KEY variable and paste your IAM secret key from step #13 above.

Deploying App

  1. Make a small change to your src/App.js file in the greeting text.

  2. In the project root, in your terminal run:

git add. git commit -m “testing deployment" git push origin master 3. Go to your Travis Dashboard and check the status of your build.

  1. The status should eventually return with a green checkmark and show "build passing"

  2. Go to your AWS Elasticbeanstalk application

  3. It should say "Elastic Beanstalk is updating your environment"

  4. It should eventually show a green checkmark under "Health". You will now be able to access your application at the external URL provided under the environment name.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published