Reference: Dockerize React App
In the project directory, you can run:
This command runs the app in development mode.
Open http://localhost:3000 in your browser to view it.
The page will automatically reload when you make changes.
You may also see any lint errors in the console.
To run the app in production mode, execute the above commands.
Open http://localhost:80 in your browser to view it.
If you stop the container and want to run it again:
-
Sign in to hub.docker.com
-
Create a Docker Hub repository
-
Build the Docker image locally
- Rename the image
- Push the image
- Pull an image from Docker Hub
- Run the image as a container
- Create an Amazon Elastic Container Registry (ECR) repository
(Note: View ECR commands in the repository)
- Configure AWS locally
- Log in to AWS ECR
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/e1p5h8o7
- Rename the image
- Push the image to AWS ECR
Reference: YouTube Tutorial
-
Remove "https" from the public IPv4 address
-
Open Security groups and add inbound rules: All traffic, anywhere
-
Check VPC configuration