In this video I will walk you through how to setup a react app in a docker container. I'll go over some of the challenges that you may face, and we'll take a look at how we can setup both a development and a production environment to host react apps in docker containers.
In the video i forgot to point out that when you're running react in docker containers you will may to add the "-it" flag during the docker run command. This seems to vary based on what version of CRA you are running. As an example:
docker run -it d --name react-app -p 3000:3000 react-image
▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
00:00 Intro
00:12 Initialize React App
00:46 Building an Image with Dockerfile
12:56 Creating first container
14:20 Docker networking - forwarding ports
19:25 dockerignore files
24:07 Bind mounts to sync src code
35:22 Read only bind mounts
37:44 Environment variables
43:02 Docker Compose
58:15 Multi-stage Build for Production with NGINX
1:11:42 Development vs production workflow
1:22:57 docker build with --target flag
#docker
If you like this video please subscribe to this channel. Don't let me go hungry!
https://www.youtube.com/channel/UC2sYgV-NV6S5_-pqLGChoNQhttps://twitter.com/Sanjeev_Teahttps://www.instagram.com/sanjeev_tea/
▬▬▬▬▬▬ Support this garbage Channel 🍒 ▬▬▬▬▬▬
Patreon: https://www.patreon.com/sanjeevthiyagarajan
▬▬▬▬▬▬ Stalk me on Social Media 😲 ▬▬▬▬▬▬
https://twitter.com/Sanjeev_Teahttps://www.instagram.com/sanjeev_tea/https://www.facebook.com/sanjeevkt720
278 Comments